| 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dot | . (dot) | Matches any single character except line break characters. Most regex flavors have an option to make the dot match line break characters too. | . matches x or (almost) any other character | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES |
| Not a line break | \N | Matches any single character except line break characters, like the dot, but is not affected by any options that make the dot match all characters including line breaks. | \N matches x or any other character that is not a line break | V2 | no | no | no | no | no | no | no | no | YES | 8.10 | YES | YES | XE7 | YES | no | no | no | no | no | no | no | no | no |
| Alternation | | (pipe) | Causes the regex engine to match either the part on the left side, or the part on the right side. Can be strung together into a series of alternatives. | abc|def|xyz matches abc, def or xyz | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | YES | ECMA extended egrep awk | ECMA extended egrep awk | YES | extended | extended | YES | YES | YES |
| Alternation | \| (backslash pipe) | Causes the regex engine to match either the part on the left side, or the part on the right side. Can be strung together into a series of alternatives. | abc\|def\|xyz matches abc, def or xyz | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | basic | no | no | no |
| Alternation | Literal line feed not inside a group or character class | Causes the regex engine to match either the part on the left side, or the part on the right side. Can be strung together into a series of alternatives. | abc def xyz matches abc, def or xyz | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | grep egrep | grep egrep | no | no | no | no | no | no |
| Alternation | Literal line feed inside a group but not inside a character class | Causes the group to match either the part on the left side, or the part on the right side. Can be strung together into a series of alternatives. | a(bc de fg)h matches abch, adeh or afgh | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | grep egrep | no | no | no | no | no | no |
| Alternation is eager | | or \| | Alternation returns the first alternative that matches. | a|ab matches a in ab | YES | YES | YES | YES | YES | YES | YES | YES | option | YES | YES | YES | YES | YES | YES | YES | ECMA | ECMA | no | no | no | YES | YES | YES |
| Alternation is greedy | | or \| | Alternation returns the longest alternative that matches. | a|ab matches ab in ab | no | no | no | no | no | no | no | no | option | no | no | no | no | no | no | no | extended grep egrep awk | extended grep egrep awk | YES | extended | YES | 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/refbasic.html
Page last updated: 13 October 2025
Site last updated: 09 January 2026
Copyright © 2003-2026 Jan Goyvaerts. All rights reserved.