The great thing about regular expression languages is that there are so many to choose from!

Raymond Chen

Before you ask a question about regular expressions, you should make sure you and your audience agree on which regular expression language you are talking about.

Here is a handy table of which features are supported by which regular expression language.

You can use that table to solve this customer’s problem:

I have a regular expression that works just fine when I test it in ⟨insert regular expression testing tool, like RegExr or RegexPlanet⟩, but I can’t get it to work in real life.

C:\> findstr /r /c:"a(?!.*b)" file.txt
(prints no results!)
C:\>

My goal is to find all lines that contain an a not followed anywhere by a b.

0 comments

Discussion is closed.

Feedback usabilla icon