Perl supports the metacharacters and metasequences listed in Table 1-3 through Table 1-7. For expanded definitions of each metacharacter, see Section 1.2.1.
Sequence |
Meaning |
|
Alert (bell). |
|
Backspace; supported only in character class. |
|
ESC character, |
|
Newline; |
|
Carriage return; |
|
Form feed, |
|
Horizontal tab, |
|
Character specified by a two- or three-digit octal code. |
|
Character specified by a one- or two-digit hexadecimal code. |
|
Character specified by any hexadecimal code. |
|
Named control character. |
|
A named character specified in the Unicode standard or listed in
|
Class |
Meaning |
|
A single character listed or contained in a listed range. |
|
A single character not listed and not contained within a listed range. |
|
POSIX-style character class valid only within a regex character class. |
. |
Any character except newline (unless single-line mode,
|
|
One byte; however, this may corrupt a Unicode character stream. |
|
Base character followed by any number of Unicode combining characters. |
|
Word character, |
|
Non-word character , |
|
Digit character, |
|
Non-digit character, |
|
Whitespace character, |
|
Non-whitespace character, |
|
Character contained by given Unicode property, script, or block. |
|
Character not contained by given Unicode property, script, or block. |
Sequence |
Meaning |
|
Start of string, or after any newline in multiline match mode,
|
|
Start of search string, in all match modes. |
|
End of search string or before a string-ending newline, or before any
newline in multiline match mode, |
|
End of string or before a string-ending newline, in any match mode. |
|
End of string, in any match mode. |
|
Beginning of current search. |
|
Word boundary. |
|
Not-word-boundary. |
|
Positive lookahead. |
|
Negative lookahead. |
|
Positive lookbehind; fixed-length only. |
|
Negative lookbehind; fixed-length only. |
Modifier |
Meaning |
|
Case-insensitive matching. |
|
|
|
Dot (.) matches newline. |
|
Ignore whitespace and allow comments ( |
|
Compile pattern only once. |
|
Turn listed modes ( |
|
Turn listed modes ( |
|
Turn listed modes ( |
|
Turn listed modes ( |
|
Treat substring as a comment. |
|
Treat rest of line as a comment in |
|
Force next character to uppercase. |
|
Force next character to lowercase. |
|
Force all following characters to uppercase. |
|
Force all following characters to lowercase. |
|
Quote all following regex metacharacters. |
|
End a span started with U, L, or Q. |
Sequence |
Meaning |
|
Group subpattern and capture submatch into
|
|
Contains text matched by the |
|
Groups subpattern, but does not capture submatch. |
|
Disallow backtracking for text matched by subpattern. |
|
Try subpatterns in alternation. |
|
Match 0 or more times. |
|
Match 1 or more times. |
|
Match 1 or 0 times. |
|
Match exactly |
|
Match at least |
|
Match at least |
|
Match 0 or more times, but as few times as possible. |
|
Match 1 or more times, but as few times as possible. |
|
Match 0 or 1 time, but as few times as possible. |
|
Match at least n times, but as few times as possible. |
|
Match at least x times, no more than y times, but as few times as possible . |
|
Match with if-then-else pattern where |
|
Match with if-then pattern. |
|
Execute embedded Perl code. |
|
Match regex from embedded Perl code. |
52.15.160.43