34 how to optimize regular expression for letters of the Russian alphabet in 1?

0 like 0 dislike
16 views
re:\\a{3,}|AAA
re:\\W{3,}|BBB
re:\\in{3,}|BBB
re:\\g{3,}|GGG
re:\\d{3,}|DDD
re:\\s{3,}|Eee

абвгдеежзийклмнопрстуфхцчшщъыьэюя
asked by | 16 views

2 Answers

0 like 0 dislike
re:([a-ll])\\1{2,}
answered by
0 like 0 dislike
To use a backreference
try something like this:

re:([a-za-z])\\1{2,}|\\1\\1\\1
answered by
110,581 questions
257,150 answers
0 comments
476 users