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

Answer:

Stringa145ab23cd3644eeaaaabcd
Match or
Reject?
Accept Accept Accept Reject Reject Accept Reject

Practice

Regular Expression
(Delimit with quotes)
String
(Delimit with quotes)

Time to practice with disjunction. For each row of the following table, find a regular expression that matches each example string in that row.

Language Example Strings
Any number of A's or any number of B's AAA BBBB Ø
One or more A's or any single character not an AAAA C x
An integer or a decimal fraction143 834.91 89.0

For the last row, ensure that if the string has a decimal point, then the decimal point is followed by at least one digit (a single digit zero is acceptable after a decimal point). Remember to escape the decimal point with a backslash.


QUESTION 7:

Determine the regular expressions