Issue
I need to search multiple xhtml documents looking for the following: any tag where there's the string action= but not the string update= I'm using the Eclipse Search, so i need the regex in Java format
If i'm not wrong this can be achieved with the following (i also ignore spaces between action/update and = )
^(?!.*update\s*=).*action\s*=.*$
My problem is a single line search like this would not be enough, since html tags could span across multiple lines.
So, i would need to look between the < and the > of the tag, even if on different line.
Can that be achieved?
Example lines i want to match (i don't care if the part gets ignored:
<a href="#" action="test" update="test_container"></a>
<a href="#" action="test2"
update="test_container2"></a>
<mytag href="#" update="test_container3"
action="test3" />
Solution
action=
, but not update=
inside <...>
:
<([^>](?!update\s*=))*action\s*=([^>](?!update\s*=))*>
Answered By - howlger