I want a regular expression (in php) to this (same character 3 times):
aa => false
aaa => true
baaa => true
aaab => true
aaaaaab => true
baaab => true
babababa => false
For any character, not only 'a' and 'b'.
You can use back-references within a regex
/(.)\1\1/
Try this regular expression:
(.)\1{2}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With