grep: Regular Expressions

1 
1 3 Regular Expressions
1 *********************
1 
1 A “regular expression” is a pattern that describes a set of strings.
1 Regular expressions are constructed analogously to arithmetic
1 expressions, by using various operators to combine smaller expressions.
1 ‘grep’ understands three different versions of regular expression
1 syntax: basic (BRE), extended (ERE), and Perl-compatible (PCRE). In GNU
1 ‘grep’, there is no difference in available functionality between the
1 basic and extended syntaxes.  In other implementations, basic regular
1 expressions are less powerful.  The following description applies to
1 extended regular expressions; differences for basic regular expressions
1 are summarized afterwards.  Perl-compatible regular expressions give
1 additional functionality, and are documented in the pcresyntax(3) and
1 pcrepattern(3) manual pages, but work only if PCRE is available in the
1 system.
1 

Menu