Regular Expressions 101

Community Patterns

Find multiple consecutive occurrences of identical digits in a number

1

Regular Expression
PCRE (PHP <7.3)

Description

Example: Find the digit that repeats three times in a row in "451999277". Regex: "(\d)\1\1" (\d) - capture group for the digit and first occurrence \1 - matches one more consecutive occurrence of captured digit

Submitted by anonymous - 4 years ago