2. Write UNIX regular expressions describing the following languages. (a) Number
ID: 3719157 • Letter: 2
Question
2. Write UNIX regular expressions describing the following languages. (a) Numbers with a mantissa followed by an optional exponent, where the mantissa has at least one digit and an optional decimal point, and the exponent has an e or E optionally followed by a minus sign, followed by at least one digit. (b) Ruby variables, which start with either S or @ or a letter or underscore, followed by 0 or more letters, underscores, or digits. (c) The set of all strings of valid US phone numbers. Your expression should at least match the following strings: (555) 555-5555, 555-555-5555, (555)555-5555, 555.555.5555 (d) The set of all sentences in the sheep language, like "Baaaa!", "Baaaaaaaa!", andExplanation / Answer
Regular Expressions:
“grep” command is used to pull required aspect or portion of a large file.
grep stands for “Get Regular Expression “.
Below is the syntax for grep command
grep PATTERN Filename
---------------------------------------------------------------------------------------
Below are the UNIX Regular Expressions for above mentioned expressions:
----------------END OF THE ANSWER-------------------------
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.