Regex

Oct 29, 2020 00:00 · 56 words · 1 minute read

There are some notes on useful regular expressions

Looking for lines that don’t contain a word

Stack Overflow has the answer here

Want to match lines without “notpresent”?

^((?!notpresent).)*$

Removing duplicate lines in VS Code

From toniguga.it:

Use this regular expression:

^(.*)(\n\1)+$

Along with a replacement of $1, and all duplicate lines are removed. Really handy!

tweet Share