Regex: Odd number of occurrences of a char

regex

Solution

The following regex should work.

\b[bc]*a(([bc]*a){2})*[bc]*\b

Problem

Found nothing specific to my problem in searches: I have an Alphabet {a,b,c}, where I need to produce a set of strings that have an odd number of a's. Valid: ababaccccc baaaccccc cab caabaaac InValid: baac caacccb caabbbaac Attempt: `\b[bc]*a{3}[bc]*\b` but this is very limited.

Original source