grep . quantifiers. regular expressions.

commandline session

$ 4.2.20 10 510---> cat worked
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 11 511---> cat worked | grep -E ?sort
Bubble sort
Selection sort
Insertion sort
Shell sort
Comb sort
Merge sort
Heapsort
Quicksort
Counting sort
 Bucket sort
 Radix sort
 Distribution sort
 Timsort
$ 4.2.20 12 512---> cat worked | grep  ?sort
$ 4.2.20 13 513--->

$ 4.2.20 17 517---> echo "(555) 123-4567" | grep -E '^(?[0-9][0-9][0-9])? [0-9]
[0-9][0-9]$'
(555) 123-4567
$ 4.2.20 18 518---> echo "(555) 123-4567" | grep -E '^([0-9][0-9][0-9])? [0-9]
[0-9][0-9]$'
(555) 123-4567
$ 4.2.20 19 519---> echo "(555) 123-4567" | grep -E '^([0-9][0-9][0-9]) [0-9]
[0-9][0-9]$'
(555) 123-4567
$ 4.2.20 20 520--->


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s