K
K
knowledge2020-04-20 13:01:13
Regular Expressions
knowledge, 2020-04-20 13:01:13

How to find duplicate numbers in regular expression?

Essence of the question: you need to find repeated digits, let's say from 4 or more repeating digits.
Array of digits
1234
1111
2222
1000
Must be found
1111
2222

To find repetitions of a particular number 1, you can use the regular expression '^[1]{4,}$'
I don't want to write separate regular expressions for each of the 9 digits, can I find it through one regular expression?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-04-20
@knowledge

^(\d)\1{3,}$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question