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?
你需要双重转义反斜杠: ".signature=(.*)/\\\\("
。这是一个有效的正则表达式,但它会匹配/
char。如果你不需要它,只需删除它;)
Some issues with your code:
/
of your regex .*
you should better use [^(]+
Modified code:
html.match(/\.signature=([^(]+)/);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.