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

Does [^aeiou][aeiou][^aeiou] match bat?


Yes, as well as rat, dog, fog and many other strings.

Automaton for Range

three state finite automaton

The above automaton corresponds to the regular expression [a-z][^0-9]. The transition from state q1 to q2 should properly be labeled with all the characters that can cause that transition. However, if the alphabet consists of all ASCII characters, the transition would be labeled with too many characters. It is just as easy to label it with part of a regular expression. However, recall that the transition from state q1 to q2 eats just one character.


Does the above automaton (and regular expression) match the string b# ?