Regular Expressions 101

Community Patterns

Community Library Entry

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 - 7 years ago