How can I use JavaScript on the client side to find a search term in a paragraph while excluding any matches that are part of a URL?
I attempted to use the following regex but encountered an error: "A quantifier inside a lookbehind makes it non-fixed width."
(?<!(http:|https).*)Driving
Example text:
<small><span class="link-small">>>8833079</span></small><br />Do you think driving is fun?<br /> hi<br /> http://www.driving.com
I'm looking to match the first instance of "driving" but not the second, which is within a URL.
Thank you