Write regular expressions for the following languages. By “word”, we mean an alphabetic string separated from other words by whitespace, any relevant punctuation, line breaks, and so forth. (a) The set of all alphabetic strings; (b) The set of all lower case alphabetic strings ending with a letter b; (c) The set of all strings with two consecutive repeated words (e.g., “Humbert Humbert” and “the the” but not “the bug” or “the big bug”); (d) All strings that start at the beginning of the line with an integer and that end at the end of the line with a word; (e) All strings that have both the word grotto and the word raven in them (but not, e.g., words like grottos that merely contain the word grotto);
Write regular expressions for the following languages. By “word”, we mean an alphabetic string separated from other words by whitespace, any relevant punctuation, line breaks, and so forth.
(a) The set of all alphabetic strings;
(b) The set of all lower case alphabetic strings ending with a letter b;
(c) The set of all strings with two consecutive repeated words (e.g., “Humbert Humbert” and “the the” but not “the bug” or “the big bug”);
(d) All strings that start at the beginning of the line with an integer and that end at the end of the line with a word;
(e) All strings that have both the word grotto and the word raven in them (but not, e.g., words like grottos that merely contain the word grotto);
Trending now
This is a popular solution!
Step by step
Solved in 2 steps