Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(0*10*)((11)*|0*)((0*10*10*)*|111)0*
/
g

Description

L2 = {w ∈ Σ ∗ = {0, 1} ∗ | |w|1 = 2k + 1, k ∈ N}

Submitted by Alan Dantas - a year ago