The introduction explains how to read the regular expressions reference tables.
Use this quick reference if you’ve seen some syntax in somebody else’s regex and you have no idea what feature that syntax is for. Use the full reference tables listed below if you know what feature you want but don’t remember the syntax.
Literal Characters, Special Characters, and Non-Printable Characters
Most characters match themselves. Some characters have special meanings and must be escaped. Non-printable characters are easier to enter using control character escapes or hexadecimal escapes.
Basic regular expression features supported by most regular expression flavors.
Character Classes and Character Class Operators
A character class or character set matches a single character out of several possible characters, consisting of individual characters and/or ranges of characters. A negated character class matches a single character not in the character class. Character class subtraction and intersection allow you to match one character that is present in one set of characters and not/also present in another set of characters.
Shorthand character classes allow you to use common sets of characters quickly. You can use shorthands on their own or as part of character classes.
Anchors are zero-length. They do not match any characters, but rather a position. There are anchors to match at the start and end of the subject string, and anchors to match at the start and end of each line.
Word boundaries are like anchors, but match at the start of a word and/or the end of a word.
Repetition Using Various Quantifiers
Quantifiers allow you to repeat an item a specific or an unlimited number of times.
By placing parentheses around part of the regex, you tell the engine to treat that part as a single item when applying quantifiers or to group alternatives together. Plain parentheses also create capturing groups allow you to reuse the text matched by part of the regex. Backreferences to capturing groups match the same text that was previously matched by that capturing group, allowing you to match patterns of repeated text. Other types of groups are non-capturing.
Named Groups and Backreferences
Regular expressions that have multiple capturing groups are much easier to read and maintain if you use named capturing groups and named backreferences.
Lookaround checks whether its contents can be matched without actually adding its match to the overall regex match. Conditionals check whether a capturing group participated or whether a lookaround can be matched and then proceed to match one of two alternatives.
Unicode Characters and Properties
If your regular expression flavor supports Unicode then you can use special Unicode regex tokens to match specific Unicode characters, or to match any character that has a certain Unicode property.
Change matching modes such as "case insensitive" for specific parts of the regular expression.
Recursion, Subroutine Calls, and Balancing Groups
Subroutine calls allow you to write regular expressions that match the same constructs in multiple places without having to duplicate parts of your regular expression. Recursion and balancing groups allow you to match arbitrarily nested constructs.
Improve the performance of complex regular expressions by pruning backtracking positions and skipping over matches. Requires a deep understanding of how the regular expression engine works.
| 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/refflavors.html
Page last updated: 22 May 2025
Site last updated: 14 October 2025
Copyright © 2003-2025 Jan Goyvaerts. All rights reserved.