Regex
edition 0.12a
19 September 1992
Kathryn A. Hargreaves
Karl Berry
Overview
Regular Expression Syntax
Syntax Bits
Predefined Syntaxes
Collating Elements vs. Characters
The Backslash Character
Common Operators
The Match-self Operator (
ordinary character
)
The Match-any-character Operator (
.
)
The Concatenation Operator
Repetition Operators
The Match-zero-or-more Operator (
*
)
The Match-one-or-more Operator (
+
or
\+
)
The Match-zero-or-one Operator (
?
or
\?
)
Interval Operators (
{
...
}
or
\{
...
\}
)
The Alternation Operator (
|
or
\|
)
List Operators (
[
...
]
and
[^
...
]
)
Character Class Operators (
[:
...
:]
)
The Range Operator (
-
)
Grouping Operators (
(
...
)
or
\(
...
\)
)
The Back-reference Operator (
\
digit
)
Anchoring Operators
The Match-beginning-of-line Operator (
^
)
The Match-end-of-line Operator (
$
)
GNU Operators
Word Operators
Non-Emacs Syntax Tables
The Match-word-boundary Operator (
\b
)
The Match-within-word Operator (
\B
)
The Match-beginning-of-word Operator (
\<
)
The Match-end-of-word Operator (
\>
)
The Match-word-constituent Operator (
\w
)
The Match-non-word-constituent Operator (
\W
)
Buffer Operators
The Match-beginning-of-buffer Operator (
\`
)
The Match-end-of-buffer Operator (
\'
)
GNU Emacs Operators
Syntactic Class Operators
Emacs Syntax Tables
The Match-syntactic-class Operator (
\s
class
)
The Match-not-syntactic-class Operator (
\S
class
)
What Gets Matched?
Programming with Regex
GNU Regex Functions
GNU Pattern Buffers
GNU Regular Expression Compiling
GNU Matching
GNU Searching
Matching and Searching with Split Data
Searching with Fastmaps
GNU Translate Tables
Using Registers
Freeing GNU Pattern Buffers
POSIX Regex Functions
POSIX Pattern Buffers
POSIX Regular Expression Compiling
POSIX Matching
Reporting Errors
Using Byte Offsets
Freeing POSIX Pattern Buffers
BSD Regex Functions
BSD Regular Expression Compiling
BSD Searching
GNU GENERAL PUBLIC LICENSE
Preamble
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
Appendix: How to Apply These Terms to Your New Programs
Index