阅读背景:

如何在Javascript正则表达式中使用变量

来源:互联网 

I want to build a RegEx in JavaScript that matches a word but not part of it. I think that something like \bword\b works well for this. My problem is that the word is not known in advance so I would like to assemble the regular expression using a variable holding the word to be matched something along the lines of:I want to build a RegEx in JavaScript that matc




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: