MartijnK MartijnK - 7 months ago 23
Javascript Question

Regex pattern to find a multiple non-digit characters recurring

I'm trying to get regex to find matches where in a string of numbers there are more than one instance of a non-digit chracter following each other.


would not be a match, but
would be (twice).

Thus far I have mangled this together:
, which checks for multiple instances of
() -+
following each other, but it misses
for instance.

([()\\-+ ])\\1
also finds two (or more) of the same character in a row, but it misses

I'm assuming that something like a not-digit (
) would be easier than defining every character you don't want, but I don't see how to include that.


There is a not-digit character class which is \D, so just try \D\D
See this regex101 for a quick example