Awesome Regex curates the best regular expression tools, tutorials, libraries, and other resources, covering all major regex flavors.
Regular expressions (regex or regexp) are a powerful and concise way to search, parse, and process text. They're built into many programming languages, text editors, IDEs, database engines, word processors, and other tools.
Contributions are welcome. Add links through pull requests (guidelines).
๐ GlossaryA brief glossary of regular expression terms as used in this list.
Regex+ is a lightweight JavaScript library for more readable, high-performance, native JavaScript regexes with powerful features including free spacing, atomic groups, possessive quantifiers, subroutines, subroutine definition groups, and context-aware interpolation.
For building, testing, and playing with regexes.
Command line
By flavor
Multiple flavors
Build regexes without writing regex syntax or code.
X
and explain it step by step".Visualize how your regular expressions are structured or operate.
Search and replace through files.
โ See also: Feature comparison of grep-like tools.
Learn how to use regular expressions.
Major regex implementations, built into programming languages or as standalone libraries.
Official regex references and guides.
โน๏ธ Raku (formerly Perl 6) reimagines regexes. See: Grammars (tutorial), Regexes (best practices).
Read or contribute to the code behind major regex implementations.
Syntax and behavior differences between regex flavors.
Pattern and engine performance, benchmarks, and ReDoS prevention.
Crafting efficient regexesโน๏ธ With backtracking engines, how you craft a regex can affect how fast it finds matches or reports failures.
โณ๏ธ Notable mentionsregex
fast.std::regex
, and others.โ ๏ธ These tools have limitations on supported syntax.
Prewritten regexes for specific tasks.
Many regexes found online are low quality. It's risky to use regexes you don't fully understand in code, since they might have false positives/negatives, be vulnerable to performance problems with certain target strings, or assume a different regex flavor.
JavaScript regex librariesOpen source JavaScript libraries for advanced regex use and processing.
Alternative regex builders and enginesregex
), vscode-oniguruma (Oniguruma).The history of improvements to regular expressions in the JavaScript standard. Starting with ES2018, includes links to the TC39 proposals where features were developed and discussed.
/[/]/
).y
(sticky
), which anchors matches to lastIndex
.u
(unicode
) [explainer] [2016 spec fix], which adds Unicode code point escapes via \u{โฆ}
, strict errors (for unreserved escapes, octal escapes, quantified lookahead, and unescaped special characters in some contexts), Unicode case-folding for flag i
, and code point matching (with impact on quantifiers, character classes, ranges, and built-in sets).RegExp.prototype.flags
, the ability to copy a regex using RegExp
(optionally with new flags), and support for subclassing RegExp
(along with RegExp.prototype[Symbol.match
/replace
/search
/split]
and RegExp[Symbol.species]
).s
(dotAll
), lookbehind, named capture, and Unicode properties (via \p{โฆ}
and \P{โฆ}
which require flag u
; see list).matchAll
(which returns an iterator), plus RegExp.prototype[Symbol.matchAll]
.d
(hasIndices
), which provides start/end indices for matched substrings.v
(unicodeSets
) [explainer] as an upgrade to flag u
, which adds a set of multicharacter "properties of strings" to \p{โฆ}
, multicharacter elements within character classes via \p{โฆ}
and \q{โฆ|โฆ}
, nested character classes, set operators [โฆ--โฆ]
and [โฆ&&โฆ]
, and different escaping rules within character classes. It also fixes case-insensitive matching for \p
and \P
within negated [^โฆ]
.โ See alsoEach edition from ES2019 to ES2023 added additional Unicode properties that can be used via
\p{โฆ}
and\P{โฆ}
(see lists). ES2021 added string methodreplaceAll
, although, when given a regex, the only difference from ES3'sreplace
is that it throws if not using flagg
.
l
(linear
) regex flag, behind a V8 flag [explainer] [how to run].(?<a>โฆ)|(?<a>โฆ)
.x
(extended
) with insignificant whitespace and line comments (#โฆ
), plus inline comments via (?#โฆ)
.(?ims:โฆ)
, (?-ims:โฆ)
, (?i-ms:โฆ)
.(?>โฆ)
and possessive quantifiers (ex: *+
, ++
).\A
and \z
, not affected by flag m
.\R
matches any line terminator.RegExp
subclassing.RegExp.escape
.A curated list of regex books.
A curated list of regex articles.
Discuss, assist, and get help with regular expressions.
Other interesting, fun, and useful stuff.
Awesome Regex was created by Steven Levithan and contributors.
If you want to support this project, I'd love your help by contributing improvements, sharing it with others, or sponsoring ongoing development.
ยฉ 2024โpresent. CC BY 4.0.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3