I have a regular expression that is functional in PHP:
(?<![\/?$])\bfoo\b
Now, I am trying to adapt it for use in JavaScript. Specifically, I want it to match the following patterns:
foo - need this
<div>foo</div> - need this
Foo - don't need this
foobar - don't need this
/foo/ - don't need this
Update: Check out the solution here.