Is there a way to check to see if each unique character occurs the same amount of times? Soley using the regex language or do I have use regex and str.count to find a valid match?
This is what I'm expecting the results to be:
xy -> valid
xxyy -> valid
xxxyyy -> valid
xyy -> not valid
xxy -> not valid
I know I can do something like:
matches = re.match(r"^x+y+$", myTestStr)
But is there any way I have the '+' token for 'x' be the same as the '+' token for 'y'? I've also tried working with groups but have had no luck there either.