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

Answer:

\$(0|[1-9][0-9]*)(\.[0-9][0-9])?


Pricey Finite Automaton

pricey finite automaton

The automaton that corresponds to this RE.

The '.' character is escaped because we want to match '.' and not any character. The dollar sign is escaped \$ becase it also has a special meaning in regular expressions, not yet discussed.


QUESTION 13:

Write a RE that matches strings that start with an 'a' and end with a 'b' and have any number of a's and b's in the middle.