I have string look like this :
"fdsgsgf.signature=xxxxx(bv)"
And i want to get xxxxx
With : var testRE = html.match(".signature=(.*)/\(");
And when i run it i get exception that it's not valid regex.
Any idea why?
Some issues with your code:
/ of your regex.* you should better use [^(]+Modified code:
html.match(/\.signature=([^(]+)/);
/ isn't missing. If you use a string then you don't have the slashes.regexYou need to double escape the backslash: ".signature=(.*)/\\(". This is a valid regex, but it will match the / char though. If you don't need it, simply remove it ;)
html.split("=")[1].split("(")[0].. can make better though.