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 comment

Your email address will not be published. Required fields are marked *