Sublime Forum

Regex: Select all lines that do not contain a particular tag in front of another particular tag

#1

good day and Merry Christmas to all.

I want to find a regex formula as to select all line that does not have <p class="testa_formal"> in front of <span class="testa_formal2">

<p class="testa_formal"><span class="testa_formal2">* Note: </span>

I made a regex, but is not too good.

(?s)\A(?!.*?(?<!\w)(<span class="testa_formal2">)(?!\w)<p class="testa_formal">).*

Can anyone help me a little bit?

0 Likes

#2

ok, I believe I find the answer:

SEARCH:

^(?:(?!<p class="testa_formal">).)*<span class="testa_formal2">.*$

or

^(?:(?:.*?!<p class="testa_formal">(?:(?!<span class="testa_formal2">).)*)|(?:(?!<p class="testa_formal">).)*<span class="testa_formal2">.*)$

0 Likes