1
这正则表达式是工作在PHP包围的话:JS正则表达式匹配的话,排除斜线
(?<![\/?$])\bfoo\b
我需要使它在JS工作,所以
foo - need this
<div>foo</div> - need this
Foo - dont need this
foobar - dont need this
/foo/ - dont need this
更新:>solution<
它几乎是正确的,但观看第二场比赛 – Qteb
@Qteb这就是为什么我写的,抢'组1'而不是'match'。 – vks
我不明白你的意思,你的例子工作不正常 - > https://regex101.com/r/cJ6zQ3/38 – Qteb