Previous: r-command Up: ../info.html Next: right-angle-command
A regular expression is a text pattern made up of a concatenation of the
following elements:
c literal character c
? any character except newline
^ beginning of line
$ end of line (null string before newline)
[...] character class (any one of these characters)
[~...] negated character class (all but these characters)
* closure (zero or more occurrences of previous pattern)
@c escaped character (e.g. @^, @$, @[, @*,)
Special meaning of characters in a text pattern is lost when escaped,
inside [...] (except for @]), or for:
^ not at beginning of pattern
$ not at end of pattern
* at beginning of pattern
A character class consists of zero or more of the following elements,
surrounded by [ and ]:
c literal character c, including [
c1-c2 range of characters (digits, lower or upper case letters)
~ negated character class if at beginning
@c escaped characters (e.g. @~, @-, @@, @])
Special meaning of characters in a character class is lost when escaped
or for:
~ not at beginning
- at beginning or end
An escape sequence consists of the character @ followed by a single
character:
@n newline
@N newline
@t tab
@T tab
@c c (include @@)
For example, to match all words beginning with a letter, followed by
zero or more letters or digits, and ending with an "s", use the pattern:
[a-zA-Z][a-zA-Z0-9]*s[~a-zA-Z0-9]