If I wanted to match a string with As,Bs,Cs but my string cannot contain more than one 1 B and no more than 4Cs? How would I do this, without making it very long? I have a solution in which I make every combination of the letter B and arrangement of Cs and A*.
The Regex should match strings like:
AABCCCC
BAAACC
BAACACC
But not things like:
AABB
BBBACCC
CACACACC