0

I have a text file in VSCode and using the Find panel, Ctrl+F, I want to select all lines not containing the string ;[\w\w]:

Sendinput, {f1}+{Insert}
Sendinput, {f1}+{Pause}
Sendinput, {f1}+{Home}
Sendinput, {f1}+{PgUp}
Sendinput, {f1}+{PgDn}

Sendinput, {f2}{a}             ;[2r] [3D Model Tre]
Sendinput, {f2}{b}             ;[3b] [Accessibility Checker ]
Sendinput, {f2}{c}             ;[2z] [Accessibility Report r]
Sendinput, {f2}{d}             ;[5r] [Attachments]

I have tried:

Send.*[^;\[\w\w\]]

But it selects all the lines anyways.

  • 1
    try `^(?!.*;\[\w\w\]).*$` – MarkBeras Jul 31 '23 at 17:22
  • 1
    Does this answer your question? [Regular expression to match a line that doesn't contain a word](https://stackoverflow.com/questions/406230/regular-expression-to-match-a-line-that-doesnt-contain-a-word) – InSync Jul 31 '23 at 17:25
  • @MarkBeras That worked, thank you. I dont know why you did not post that is an answer. – Ralf_Reddings Jul 31 '23 at 21:26
  • @InSync I could not figure how to use the suggested link but thank you though. – Ralf_Reddings Jul 31 '23 at 21:27
  • None of the lines contain the string `";[\w\w]"`. I'm guessing that you wish to match all the lines that do not match the regular expression `";\[\w\w\]"` (Note `[` and `]` must be escaped.) Try `^(?!.*;\[\w\w\]).*`, where `^` is a beginning-of-string anchor and `(?!...)` is a *negative lookahead* . [Demo](https://regex101.com/r/LZDKAH/1) – Cary Swoveland Jul 31 '23 at 23:21

0 Answers0