Regex: Difference between revisions
→Character Escapes
Line 36:
== Character Escapes ==
{| class="wikitable"
Escaped Char || Description▼
|-
ordinary characters || Characters other than . $ ^ { [ ( | ) ] } * + ? \ match themselves.▼
|-
\b Matches a backspace \u0008 if in a []; otherwise matches a word boundary (between \w and \W characters).▼
▲
\t Matches a tab \u0009.▼
|-
\r Matches a carriage return \u000D.▼
| \
|-
\f Matches a form feed \u000C.▼
▲| \b
\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).▼
| \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.▼
|-
|-
|-
|-
▲| \040
|-
|-
|-
|-
▲| \*
|}
== Character Classes ==
|