regex - How to write a Regexp for any character, but it must be the same a specific number of times -
i want find strings same character multiple times in row. these can character (including null char), cannot specify character is, occurs 20 or more times in row.
the dot "." matches character, how specify in regexp, must same character if don't know beforehand?
example: bla bla blub oooooooooooooooooo must in xxxxxxxxxxxxxxxxx string.
i want find o-s , x-s lines. ".{10,}" matches line.
you can capture letter , use back-reference 9 times check if same letter repeated 10 times:
/([a-za-z])\1{9,}/g
ps: check of character use:
/(.)\1{9,}/g
Comments
Post a Comment