Does [wW][hH][yY]
match wHy ?
Yes.
The following automaton corresponds to the RE [wW][hH][yY]
.
Each state transition consumes just one character. Each transition is labeled with the choices for that character.
The RE could have been written [Ww][hH][Yy]
or in any of several
other ways (since the order of characters inside brackets does not matter).
Write a regular expression that matches strings that start with 'A' followed by a single 'X' or 'Y'.
Remember that upper and lower case make a difference.