go to previous page   go to home page   go to next page
[ABC]{2,4}[XYZ]{2,4}

Answer:

It matches strings that start with two through four characters from 'A', 'B', or 'C' followed by two through four characters of 'X', 'Y', or 'Z'.


The Expression as an Automaton

The finite automaton for this is straightforward:

[ABC]{2,4}[XYZ]{2,4}

QUESTION 19:

Write a regular expression that matches strings that have no more than 5 'A' followed by a 'Z'.