1

This one should be simple.

I want to match any numbers that do NOT have a series of numbers in the front.

I have the regex, but it does the exact opposite. I need an inverse of it.

Examples:

123456 - NOT MATCH
456789 - MATCH
451236 - MATCH

Right now, it's the opposite of the above.

The regex: ^(123)

whisky
  • 533
  • 1
  • 6
  • 14

1 Answers1

1
^(?!^123)\d+

^ starts in the beginning of the line

(?!^123) not starts with 123

\d+ and then all the the digits you can get

Note that this only covers integers. You can change de last option to search other desired formats, like .5, -13.5, 2.6e+10 etc, etc...

durum
  • 3,316
  • 1
  • 25
  • 30