I have a regular expression that is running on a string of HTML, but I need to exclude anything that is between a <p></p>
tag from being able to match with my regex. Is there a way of doing this in my current regex?
My regex (matches: $, %, decimal, and whole number values in a string): /(?:\$?)(?:\d{1,3}(?:,\d{3})*(?:\%?)|\d+)(?:\.\d+(?:\%?))?/g
Basically, this regex should match with the following.
<div>$50</div>
<p>$40</p>
<div>$30</div>
matches: $50 & $30
ignores: $40