I’ve tried several regex combinations to figure out this, but some or the condition fails,
I have an input string, that could only contain a given set of defined characters
lets say A , B or C in it.
how do I match for something like this?
ABBBCCC — isMatch True
AAASDFDCCC — isMatch false
ps. I’m using C#
Should be enough: that is using a Character class or Character Set.
The Anchors ‘^’ and ‘$’ would be there only to ensure the all String contains only those characters from start to end.
Meaning: a Character Set will not guarantee the order of he characters matched.
Would guarantee the order