I have a regex, which is suppose to validate strings like R1 AND R2 or R1 AND R3 OR R2 AND R4.
This is my regex:
^[R\d+ (\bAND\b|\bOR\b)]+ R\d+$
Today, I found out that it also accepts strings like "R1AND R2" or "R1 ANDR R2". How can I make sure that my regex must detect spaces between the R\d, AND and OR?
Thanks!