Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^1?$|^(11+?)\1+$
/
gm

Description

Matches any sequence of consecutive ones that isn't of prime length.

Submitted by anonymous - 7 years ago