|
|
Line 36: |
Line 36: |
|
|
|
|
|
== Character Escapes == |
|
== Character Escapes == |
|
|
{| class="wikitable" |
⚫ |
Escaped Char || Description |
|
|
|
|- |
⚫ |
ordinary characters || Characters other than . $ ^ { [ ( | ) ] } * + ? \ match themselves. |
|
|
⚫ |
! Escaped Char !! Description |
|
\a Matches a bell (alarm) \u0007. |
|
|
|
|- |
⚫ |
\b Matches a backspace \u0008 if in a []; otherwise matches a word boundary (between \w and \W characters). |
|
|
⚫ |
| Ordinary Characters || Characters other than <nowiki> $ . ^ { [ ( | ) ] } * + ? \ </nowiki> match themselves. |
⚫ |
|
|
|
|
|- |
⚫ |
\r Matches a carriage return \u000D. |
|
|
\v Matches a vertical tab \u000B. |
|
| \a || Matches a bell (alarm) \u0007. |
|
|
|- |
⚫ |
\f Matches a form feed \u000C. |
|
|
⚫ |
| \b || Matches a backspace \u0008 if in a [ ]; otherwise matches a word boundary (between \w and \W characters). |
⚫ |
\n Matches a new line \u000A. |
|
|
|
|- |
⚫ |
\e Matches an escape \u001B. |
|
|
⚫ |
| \t || Matches a tab \u0009. |
⚫ |
\040 Matches an ASCII character as octal (up to three digits); numbers with no leading zero are backreferences if they have only one digit or if they correspond to a capturing group number. (For more information, see Backreferences.) For example, the character \040 represents a space. |
|
|
|
|- |
⚫ |
\x20 Matches an ASCII character using hexadecimal representation (exactly two digits). |
|
|
⚫ |
| \r || Matches a carriage return \u000D. |
⚫ |
\cC Matches an ASCII control character; for example \cC is control-C. |
|
|
|
|- |
⚫ |
\u0020 Matches a Unicode character using a hexadecimal representation (exactly four digits). |
|
|
|
| \v || Matches a vertical tab \u000B. |
⚫ |
\* When followed by a character that is not recognized as an escaped character, matches that character. For example, \* is the same as \x2A. |
|
|
|
|- |
|
|
|
|
⚫ |
| \f || Matches a form feed \u000C. |
|
|
|- |
|
⚫ |
| \n || Matches a new line \u000A. |
|
|
|- |
|
⚫ |
| \e || Matches an escape \u001B. |
|
|
|- |
|
⚫ |
| \040 || Matches an ASCII character as octal (up to three digits); numbers with no leading zero are backreferences if they have only one digit or if they correspond to a capturing group number. (For more information, see Backreferences.) For example, the character \040 represents a space. |
|
|
|- |
|
⚫ |
| \x20 || Matches an ASCII character using hexadecimal representation (exactly two digits). |
|
|
|- |
|
⚫ |
| \cC || Matches an ASCII control character; for example \cC is control-C. |
|
|
|- |
|
⚫ |
| \u0020 || Matches a Unicode character using a hexadecimal representation (exactly four digits). |
|
|
|- |
|
⚫ |
| \* || When followed by a character that is not recognized as an escaped character, matches that character. For example, \* is the same as \x2A. |
|
|
|} |
|
|
|
|
|
== Character Classes == |
|
== Character Classes == |