I'm using JavaScript to try and create a regular expression that will find (in an html file) all divs that don't have an onclick attribute.
Example:
This div should be ignored..
<div class="foo"
id="bar"
onclick="someFunction()>some text</div>
This div should be matched (because it doesn't contain an onclick attribute)..
<div class="foo"
id="bar">some text</div>
I tried this but it doesn't work..
var pattern = /div[\s\w\n\=\(\)"]*(?!onclick)div[\s\w\n\=\(\)"]*">/
I'm guessing that the first part of my regular expression (before the negative look-ahead) is actually matching the negative look-ahead.
Can someone help? Thanks in advance for any suggestions.