Regular Expressions 101

Community Patterns

All strings of a's and b's with an even number of a's and an odd number of b's.

0

Regular Expression
PCRE (PHP <7.3)

/
^(?=(?:b*ab*a)*b*$)(?=(?:a*ba*b)*a*ba*$)[ab]*$
/
gm

Description

no description available

Submitted by anonymous - 4 years ago