Regular Expressions 101

Community Patterns

Bitstream with not more than 4 repeating bits

2

Regular Expression
PCRE (PHP <7.3)

/
\b(?![01]*([01])\1{4})[01]+\b
/
gm

Description

0111100 will be matched whereas 0111110 will not. Change \1{4} to max repeating count. For max 9 repeating -> \1{9}

Submitted by anonymous - 8 years ago