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