go to previous page   go to home page   go to next page

Does [wW][hH][yY] match wHy ?

Answer:

Yes.


Choice of Characters in an Automaton

The following automaton corresponds to the RE [wW][hH][yY].

four state finite automaton

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).

QUESTION 8:

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.