Is there a single regular expression that will match strings that have the letter "a" or "x" at certain indexes?
For example, the indexes may be
0, 3, 6
1, 4, 7
2, 5, 8
Possible patterns according to these indexes:
"a--a--a--"
"-x--x--x-"
"--a--a--a"
Other occurrences of "a"
or "x"
are okay. I just want to make sure certain indexes contain "a"
.
EDIT: This problem is a subproblem of a tic-tac-toe board. I'm to determine if there is a winner by using a regular expression. I don't want the answer to this. I just want a bit of a push to help me move toward the final answer. The above is to help me find a regex that would identify if there is a vertical winner.