I am currently working on a program. I need a regex that takes Y and X and that pairs of X is separated by Y. It does not have to be equal numbers, but it cannot contain multiple X'es on side of each other.
Examples:
# Don't match:
XXXYYYYY
#Match:
XYXYYYY
X
My try so far:
{Y*[X|^X]Y*[X|^X]Y*}*
The problem is that if there is a X in the first and X in the second the Y still can be 0. Can i directly test for double X's?