I am trying to get a regular expression to work but am stumped. What I want is to do the inverse of this:
/(\w)\1{5,}/
This regex does the exact opposite of what I'm trying to do. I would like to get everything but a string that has 6 repeating numbers i.e. 111111
or 999999
.
Is there a way to use a negative look-around or something with this regex?
You can use this rgex:
RegEx Demo
(?!.*?(\w)\1{5})
is a negative lookaahead that will fail the match if there are 6 consecutive same word characters in it.