Regular Expressions 101

Community Patterns

Primality

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