Reputation: 533
Expression:
/(^|[^ \/?$])\b(foo)\b/g
Test string:
foo - need this 1
<div>foo</div> - need this 2
foo - need this 3
Foo - dont need this
foobar - dont need this
/foo/ - dont need this
Substitution:
$1bar
Need help to improve this regexp to work with ex# 3. See demo
Upvotes: 0
Views: 126