Extended Regular Expressions

The three utilities egrep, grep when run with the –E option (similar to egrep), and gawk provide all the special characters that are included in ordinary regular expressions, except for \( and \), as well as several others. The vi (vim) editor includes the additional characters as well as \( and \). Patterns using the extended set of special characters are called full regular expressions, or extended regular expressions.

Two of the additional special characters are the plus sign (+) and question mark (?). They are similar to the *, which matches zero or more occurrences of the previous character. The plus sign matches one or more occurrences of the previous character, whereas the question mark matches zero or one ...

Get A Practical Guide to Red Hat® Linux® 8 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.