Regular Expressions 101

Community Patterns

To Filter string of exact length six and no repeating two digits consecutively (subset of two).

0

Regular Expression
PCRE (PHP <7.3)

/
^(?:(?:(\d)(?!\1+))(\d))(?:(?:(\d)(?!\3+))(\d))(?:(?:(\d)(?!\5+))(\d))$
/
gm

Description

To Filter string of exact length six and no repeating two digits consecutively (subset of two).

Submitted by anonymous - 6 years ago