Question: Regular expression question in Linux (Only write the regular expression. Do not include the egrep command and do not enclose it in single or double
Regular expression question in Linux (Only write the regular expression. Do not include the egrep command and do not enclose it in single or double quotes.):
1. Write a regular expression that you could use with egrep that will match all sentences that contain exactly four words separated by a space with a punctuation mark at the end. Assume that the first word of a sentence is capitalized. (Some lines may contain more than one sentence.) Use the :alpha:, :upper: and :punct: classes where appropriate.
2. Write a regular expression that you could use with egrep that will match all lines in which the letters (upper or lower case) a, b, c, and d appear in that order (not necessarily consecutively). This should, for instance, find a bat can die.
3. Write a regular expression that you could use with egrep that will match lines in the names.txt file that have cities whose names are multiple (i.e. 2 or more) words.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
