Regular Expressions 101

Community Patterns

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

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