Changes

Jump to: navigation, search

Tutorial9: Regular Expressions

631 bytes added, 09:31, 6 July 2020
INVESTIGATION 1: SIMPLE & COMPLEX REGULAR EXPRESSIONS
# Issue the following command to match strings that begin with 3 characters:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep -w -i "^..." textfile1.txt | more</span><br><br>What do you notice?<br><br>
# Issue the following command to match strings that begin and end with 3 characters:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep -w -i "^...$" textfile1.txt | more</span><br><br>What do you notice?<br><br>
# Issue the following command to match strings that begin with 3 digits:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep -w -i "^[0-9][0-9][0-9]" textfile1.txt | more</span><br><br>
# Issue the following command to match strings that end with 3 uppercase letters:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep -w -i "[A-Z][A-Z][A-Z]$" textfile1.txt | more</span><br><br>
# Issue the following command to match strings that consist of only 3 digits:<br><span style="color:blue;font-weight:bold;font-family:courier;">grep -w -i "^^[0-9][0-9][0-9]$" textfile1.txt | more</span><br><br>
=INVESTIGATION 2: EXTENDED REGULAR EXPRESSIONS =
13,420
edits

Navigation menu