Overview of regular expressions

Last edit

Summary: Extended regular expression syntax

Changed:

< The [[syntax]] of regular expressions varies across application programs.
< Regular expressions can be divided into the following categories:
< * [[Simple Regular Expression]]s - Legacy regular expressions by historical applications
< * [[Basic Regular Expression]]s - Used by traditional shell tools
< * [[Extended Regular Expression]]s - Used by extended shell tools
< *
[[Perl Compatible Regular Expression]]s - Used with enhanced tools and programming languages
< Regular expressions are usually
[[delimit]]ed by [[slash]] characters.

to

> === Extended regular expression syntax ===
> The [[syntax]] of regular expressions varies across application programs. The [[awk]] extraction and reporting language uses superset of the [[syntax]] called [[extended regular expression syntax]].


What is a regular expression?

A regular expression is a method of representing a string matching pattern. Regular expressions enable strings that match a particular pattern within textual data records to be located and modified and they are often used within utility programs and programming languages that manipulate textual data.

For example, a regular expression can be used to replace the word "Snake" with the word "Serpent" throughout an entire piece of text, or a regular expression could be used to locate particular pieces of text containing both the words "Lion" and "Lamb" on the same line. Regular expressions are extremely powerful.

Regular expressions are made up of three types of components:

Extended regular expression syntax

The [[syntax?]] of regular expressions varies across application programs. The awk extraction and reporting language uses superset of the [[syntax?]] called [[extended_regular_expression_syntax?]].