Regular Expressions 101

Community Patterns

Your search did not match anything

Community Library Entry

1

Regular Expression
Python

r"
((((?<!a)a)|((?<!b)b)|((?<!c)c))((((?<!a)a)|((?<!b)b)|((?<!c)c))(((?<!a)a)|((?<!b)b)|((?<!c)c)))*)?
"

Description

Recognizes strings containing {a,b,c} an odd number of times that do not repeat the same letter twice in a row. Also recognizes null string.

Submitted by anonymous - 9 years ago