Sublime Forum

Regex: Find out all files that do not contain some words

#1

hello. I want to find out all the files that doesn’t contain this line:

<li><a href="my_link.html">

Can anyone help me with a regex?

0 Likes

#2
(?s)\A(?!.*^<li><a href="my_link\.html">$)

obviously if you don’t want to check if it contains that exact line, just that exact text, remove the line anchors

0 Likes

#4

This is a better solution:

(?s)\A(?!.*(YOUR_WORDS).*$)

0 Likes

Searching through project for not found text (Opposite of find)
#5

When you give people very narrow specifications, they are going to give you narrow answers. When posting these kind of questions, please be clear on exactly what it is you want.

It is kind of weird when you ask a question, someone takes the time and gives you exactly what you ask for, and then you respond with nope, your regex is not very good. It might be nice to say: Thank you, but what if I also want to find <your_words> or what I'm actually looking for is <your_words>, and I think this regex is actually what I'm looking for <your_regex> . It may go a long way when trying to find help on the forums in the future :wink:.

</end_rant>

3 Likes

#6

Yes you are right. I apologize. However, my regex is actually your regex changed a little bit !

so, thank you very much

2 Likes