This may be a simple one but I can’t seem to find the answer to it.
I have a string in a HTML file that I am looking for:
<div class="button" onclick="document.$name.submit(); return false\">Save</div>
where $name is is generated by code, so can be anything.
I need to write a PCRE regular expression that will find this string in the file but disregard the $name section of the string.
I have tried this :
/<div class=\"button\" document.(.+?).submit\(\); return false\">Save<\/div>/
It will return the group that equals to what is in $name. but not define it as a match, which is what I need.
The following should work:
Most likely your problem was that you forgot to escape the parenthesis after
submit(), so it tried to matchsubmit;.