This assignment demonstrates the use of regular expressions using the grep and egrep commands - as well as the use of special characters and various quotation marks.
Create a text file that contains the following lines:
This is a line that tests * and sees if $2.00 goes far
This is line two.
This is line 3
This is line four
this is line five$
this is line six*
^ stands for the beginning of a line
Next, demonstrate the behavior of at least the following five various regular expressions:*, . (dot), $, ^, [ ], on the lines of the text file created above. Use both the grep and egrep commands for each of the five regular expressions, as well as demonstrate the use of grep and egrep without quotation marks, with single quotations, and with double quotations respectively. Also demonstrate and explain the use of the escape character \ and how it affects the output of grep/egrep. Compile the results and explain the behavior that produced the results for each of the five and the escape character. When using the [ ], enclose 23 inside – and interpret the results of the grep/egrep commands. And lastly, answer the question: “Why is there only a significant difference with the * regular expression? “
Capture screen shot(s) for all of the above operations using the five regular expressions and escape character into a separate file.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.