Write a regular expression for each of the following concepts.
a. | strings starting with a digit |
b. | strings containing only alphabetic letters |
Write a regular expression for each of the following concepts.
a. | strings containing only alphabetic letters and that start with the letter c |
b. | strings that containing only digits, but which don't start with 0 |
Write a regular expression that describes strings containing
the lower-case letter e followed by a digit, with
possibly some intervening spaces. Examples include
3e8
,
the 100K
,
and e2
, but not e-5
.
Write a regular expression that describes all words of lower-case letters that begin with w and contain an r. Examples include weird, word, wrong, and wear, but not awkward, war-weary, or www.hendrix.edu. (The latter two are bad because they contain characters that are not lower-case letters.)
Design a finite automaton that accepts strings of a's and b's that end with two a's.
Design a finite automaton that accepts strings of a's and b's that begin and end with the same letter.
Design a finite automaton that accepts strings of a's and b's that include the substring abaa.
a. | [0-9].* |
b. | [a-z]* |
a. | c[a-zA-Z]* |
b. | [1-9][0-9]* |