Regularly matches characters between two strings
Use regular expressions to match, here is matching the string between 'allowed=v' and 'l'
let str = "lorem ballaalal,allowed=valuelalala"
str = str.match(/allowed=v(\S*)l/);
console.log('====>',str)
The output is:
Characters with backslash
Strings with backslashes need to be escaped first. In strings, backslashes are used as escape characters. If you want to output '', you actually need to enter ''. The first one means escape, and the second one means escape. One is the actual output.
Use regular expressions to match, here is matching the string between 'allowed=v' and '' (backslash)
let str = "lorem ballaalal,allowed=value\\lalala"
str = str.match(/allowed=v(\S*)\\/);
console.log('====>',str)