| Replacement Reference |
| Characters |
| Matched Text & Backreferences |
| Case Conversion |
| Context |
| Conditionals |
| Feature | Syntax | Description | Example | JGsoft | Python | JavaScript | VBScript | XRegExp | .NET | Java | ICU | RE2 | Perl | PCRE | PCRE2 | PHP | Delphi | R | Ruby | std::regex | Boost | Tcl | POSIX | GNU | Oracle | XML | XPath |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Literal character | Any character except [\^$.|?*+() | All characters except the listed special characters match a single instance of themselves | a matches a | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES |
| Literal character | ] | ] is a literal character outside of character classes | } matches } | YES | YES | without /u | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | no | extended egrep awk | YES | YES | YES | YES | YES | no | no |
| Literal character | ) | ) is a literal character without a preceding ( to match it | ) matches ) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | basic extended grep egrep awk | basic grep | no | YES | YES | no | no | no |
| Literal character | { | { is a literal character, unless it is part of a valid regular expression token such as a quantifier {3} | { matches { | YES | YES | without /u | YES | YES | YES | no | no | YES | YES | YES | YES | YES | YES | YES | 1.9 | basic grep | ECMA 1.54 basic 1.38 grep 1.38 | YES | YES | basic | YES | no | no |
| Literal character | } | } is a literal character, unless it is part of a valid regular expression token such as a quantifier {3} | } matches } | YES | YES | without /u | YES | YES | YES | YES | no | YES | YES | YES | YES | YES | YES | YES | 1.9 | basic extended grep egrep awk | ECMA 1.58 basic 1.38 grep 1.38 | YES | YES | YES | YES | no | no |
| Backslash escapes a metacharacter | \ followed by any of [\^$.|?*+(){} | A backslash escapes special characters to suppress their special meaning | \* matches * | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES |
| Escape sequence | \Q...\E | Matches the characters between \Q and \E literally, suppressing the meaning of special characters | +-*/ matches +-*/ | YES | no | no | no | no | no | YES | YES | default | YES | YES | YES | YES | YES | YES | no | no | ECMA extended egrep awk | no | no | no | no | no | no |
| Hexadecimal escape | \xF where F is a single hexadecimal digit | Matches the character at the specified position in the ASCII table | \xA matches a line feed control character | no | no | no | no | no | no | no | YES | no | YES | YES | YES | YES | YES | YES | YES | string | ECMA extended egrep awk | YES | no | no | no | no | no |
| Hexadecimal escape | \x7F where 7F are 2 hexadecimal digits between 00 and 7F | Matches the character at the specified position in the ASCII table | \x40 matches @ | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | ECMA | ECMA extended egrep awk | YES | string | string | no | no | no |
| Hexadecimal escape | \xFF where FF are 2 hexadecimal digits | Matches the character at the specified position in the code page | \xA9 matches © when using the Latin-1 code page | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | no | ECMA | ECMA extended egrep awk | YES | string | string | no | no | no |
| Character escape | \n, \r and \t | Match an LF character, CR character and a tab character respectively | \r\n matches a Windows CRLF line break | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | ECMA awk | ECMA extended egrep awk | YES | string | string | no | YES | YES |
| Line break | \R | Matches any line break, including CRLF as a pair, CR only, LF only, form feed, vertical tab, and any Unicode line break | V2 | no | no | no | no | no | 8 | YES | no | YES | 7.0 | YES | YES | YES | YES | 2.0 | no | ECMA 1.42 | no | no | no | no | no | no | |
| Line break | \R | Matches the next line control character U+0085 | V2 | n/a | n/a | n/a | n/a | n/a | 8 | YES | n/a | YES | 7.0 | YES | YES | YES | YES | 2.0 | n/a | ECMA 1.54 | n/a | n/a | n/a | n/a | n/a | n/a | |
| Line break | \R | CRLF line breaks are indivisible | \R{2} and \R\R cannot match \r\n | YES | n/a | n/a | n/a | n/a | n/a | 9 no | YES | n/a | no | YES | YES | YES | YES | n/a | YES | n/a | n/a | n/a | n/a | n/a | n/a | ||
| Line break | Literal CRLF, LF, or CR line break | Matches CRLF as a pair, CR only, and LF only regardless of the line break style used in the regex | YES | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | |
| Character escape | \a | Match the “alert” or “bell” control character (ASCII 0x07) | YES | YES | no | no | no | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | awk | ECMA extended egrep awk | YES | no | no | no | no | no | |
| Character escape | \b | Match the “backspace” control character (ASCII 0x08) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | awk | no | YES | no | no | no | no | no | |
| Character escape | \B | Match a backslash | \B matches \ | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | YES | no | no | no | no | no |
| Character escape | \e | Match the “escape” control character (ASCII 0x1B) | YES | no | no | no | no | YES | YES | YES | no | YES | YES | YES | YES | YES | YES | YES | no | ECMA extended egrep awk | YES | no | no | no | no | no | |
| Character escape | \f | Match the “form feed” control character (ASCII 0x0C) | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | ECMA awk | ECMA extended egrep awk | YES | no | no | no | no | no | |
| Character escape | \v | Match the “vertical tab” control character (ASCII 0x0B), but not any other vertical whitespace. | V1 only | YES | YES | YES | YES | YES | no | YES | no | no | no | no | no | no | YES | ECMA awk | ECMA extended egrep awk | YES | no | no | no | no | no | ||
| Control character escape | \cA through \cZ | Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A | \cM\cJ matches a Windows CRLF line break | V1 only | no | YES | YES | YES | YES | YES | YES | no | YES | YES | YES | YES | YES | YES | YES | ECMA | ECMA extended egrep awk | YES | no | no | no | no | no |
| Control character escape | \ca through \cz | Match an ASCII character Control+A through Control+Z, equivalent to \x01 through \x1A | \cm\cj matches a Windows CRLF line break | V1 only | no | YES | YES | YES | YES | no | YES | no | YES | YES | YES | YES | YES | YES | YES | ECMA | ECMA extended egrep awk | YES | no | no | no | no | no |
| NULL escape | \0 | Match the NULL character | no | YES | YES | YES | YES | YES | no | no | YES | YES | YES | YES | YES | YES | YES | YES | ECMA | YES | YES | no | no | no | no | no | |
| Octal escape | \o{7777} where 7777 is any octal number | Matches the character at the specified position in the active code page | \o{20254} matches € when using Unicode | V2 | no | no | no | no | no | no | no | no | YES | 8.34 | YES | 5.5.10 | XE7 | 3.0.3 | no | no | no | no | no | no | no | no | no |
| Octal escape | \1 through \7 | Matches the character at the specified position in the ASCII table | \7 matches the “bell” character | no | no | without /u | YES | no | ECMA | no | no | no | no | no | no | no | no | no | no | awk | no | no | no | no | no | no | no |
| Octal escape | \10 through \77 | Matches the character at the specified position in the ASCII table | \77 matches ? | no | no | without /u | YES | no | YES | no | no | YES | YES | YES | YES | YES | YES | YES | YES | awk | no | YES | no | no | no | no | no |
| Octal escape | \100 through \177 | Matches the character at the specified position in the ASCII table | \100 matches @ | no | YES | without /u | YES | no | YES | no | no | YES | YES | YES | YES | YES | YES | YES | YES | awk | no | YES | no | no | no | no | no |
| Octal escape | \200 through \377 | Matches the character at the specified position in the active code page | \377 matches ÿ when using the Latin-1 code page | no | YES | without /u | YES | no | 2.0 | no | no | YES | YES | YES | YES | YES | YES | YES | 1.8 only fail | awk | no | YES | no | no | no | no | no |
| Octal escape | \400 through \777 | Matches the character at the specified position in the active code page | \777 matches ǿ when using Unicode | no | 3.5 error | no | no | no | non‑ECMA | no | no | YES | YES | 6.7 | YES | YES | YES | YES | 1.8 only fail | awk | no | no | no | no | no | no | |
| Octal escape | \01 through \07 | Matches the character at the specified position in the ASCII table | \07 matches the “bell” character | V1 only | YES | without /u | YES | no | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | awk | YES | YES | no | no | no | no | no |
| Octal escape | \010 through \077 | Matches the character at the specified position in the ASCII table | \077 matches ? | V1 only | YES | without /u | YES | no | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | awk | YES | YES | no | no | no | no | no |
| Octal escape | \0100 through \0177 | Matches the character at the specified position in the ASCII table | \0100 matches @ | V1 only | no | no | no | no | no | YES | YES | no | no | no | no | no | no | no | no | no | YES | no | no | no | no | no | no |
| Octal escape | \0200 through \0377 | Matches the character at the specified position in the active code page | \0377 matches ÿ when using the Latin-1 code page | V1 only | no | no | no | no | no | YES | YES | no | no | no | no | no | no | no | no | no | YES | no | no | no | no | no | no |
| Octal escape | \0400 through \0777 | Matches the character at the specified position in the active code page | \0777 matches ǿ when using Unicode | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | YES | no | no | no | no | no | no |
| Feature | Syntax | Description | Example | JGsoft | Python | JavaScript | VBScript | XRegExp | .NET | Java | ICU | RE2 | Perl | PCRE | PCRE2 | PHP | Delphi | R | Ruby | std::regex | Boost | Tcl | POSIX | GNU | Oracle | XML | XPath |
If you find the content on this website helpful they you may want a copy you can read offline or even print, or browse the site as often as you want without ads. You can purchase your own copy of the Regular-Expressions.info printable PDF download. As a bonus, you'll get a lifetime of advertisement-free access to this site!
| Quick Start | Tutorial | Search & Replace | Tools & Languages | Examples | Reference |
| Introduction | Table of Contents | Quick Reference | Characters | Basic Features | Character Classes | Shorthands | Anchors | Word Boundaries | Quantifiers | Capturing Groups & Backreferences | Named Groups & Backreferences | Special Groups | Unicode Characters and Properties | Unicode Versions | Unicode Categories | Unicode Scripts | Unicode Blocks | Unicode Binary Properties | Unicode Property Sets | Unicode Boundaries | Mode Modifiers | Recursion & Balancing Groups | Backtracking Control Verbs |
| Characters | Matched Text & Backreferences | Case Conversion | Context | Conditionals |
Page URL: https://www.regular-expressions.info/refcharacters.html
Page last updated: 12 September 2025
Site last updated: 09 January 2026
Copyright © 2003-2026 Jan Goyvaerts. All rights reserved.