Posts

Showing posts with the label egrep

Extended Regular Expressions Characters

 regular_express.txt   + : Repeat the previous RE character of one or more. Example : Search for "god" "good" "goood"... etc. strings.   egrep -n 'go+d' regular_express.txt     ? : Zero or one before the RE character. Example: Search for the two strings "gd" and "god". egrep -n 'go?d' --color=auto regular_express.txt   | : Find out several strings by OR. Example: Search for the two strings "gd" or "good". egrep -n 'gd|good' --color=auto regular_express.txt () :  Find group string. Example: Search for the two strings "glad" or "good", because "g" and "d" are duplicates, so I can list "la" and "oo" in () and separate them with |   egrep -n 'g(la|oo)d' --color=auto regular_express.txt ()+ :  Identification of multiple repeated groups. Example: I'm looking for a string that starts with "A" and ends with "C...