Awesome Lists with GitHub stars

[![Awesome Regex ![GitHub Repo Stars](https://img.shields.io/github/stars/slevithan/awesome-regex) ![GitHub last commit](https://img.shields.io/github/last-commit/slevithan/awesome-regex)](https://github.com/slevithan/awesome-regex/raw/HEAD/media/awesome-regex-banner.svg)](https://github.com/slevithan/awesome-regex) [![Awesome](https://awesome.re/badge-flat2.svg)](https://awesome.re)  Shortcut URL: [`regex.cool`](https://regex.cool/)

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).

📖 Glossary
*A brief glossary of regular expression terms as used in this list.* - **Regex engine:** Software that interprets and executes regular expressions, either built into a programming language or as a standalone library. - **Regex flavor:** A unique set of regex syntax and behavior. Basic syntax is typically shared across flavors, but more advanced features often vary, sometimes in subtle or incompatible ways. A flavor might be shared across multiple implementations or programming languages. - Ex: The “JavaScript” flavor is defined by the ECMAScript spec; implemented by multiple engines (V8, etc.). - Ex: The “PCRE” flavor is the PCRE2 library, used by numerous programming languages and tools. - Ex: Ruby swapped its regex implementation twice from version 1.8 → 1.9 → 2.0, so each used a distinct flavor. The Ruby 2.0+ flavor is referred to here as either “Ruby” or “Onigmo” (the underlying regex library). - **Non-backtracking engine:** A regex implementation that uses a non-backtracking algorithm and runs in linear time. This rules out worst case performance from superlinear backtracking, but it's slower with some patterns and precludes some useful features like backreferences.

Regex+ logo

</a>

Regex+ GitHub Repo Stars GitHub last commit is a lightweight JavaScript library for more readable, high-performance, native JavaScript regexes with powerful features including free spacing, atomic groups, possessive quantifiers, subroutines, definition groups, and context-aware interpolation.

Contents

Testers

For building, testing, and playing with regexes.

✳️ Notable mentions
**More bests** - [RegExr](https://regexr.com/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/gskinner/regexr) ![GitHub last commit](https://img.shields.io/github/last-commit/gskinner/regexr)](https://github.com/gskinner/regexr/)] - **Best open source tester**. - Flavors: JavaScript, PCRE. - Languages: 🇺🇸, 🇨🇳 ([fork](https://regexr-cn.com/)). - [RegexLearn](https://regexlearn.com/playground) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/aykutkardas/regexlearn.com) ![GitHub last commit](https://img.shields.io/github/last-commit/aykutkardas/regexlearn.com)](https://github.com/aykutkardas/regexlearn.com/blob/develop/src/pages/%5Blang%5D/playground.tsx)] - **Best multilingual tester** (JavaScript). - Languages: 🇺🇸, 🇹🇷, 🇷🇺, 🇪🇸, 🇨🇳, 🇩🇪, 🇺🇦, 🇫🇷, 🇵🇱, 🇰🇷, 🇧🇷, 🇨🇿, 🇬🇪. - [regexplained](https://regexplained.com/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/LeaVerou/regexplained) ![GitHub last commit](https://img.shields.io/github/last-commit/LeaVerou/regexplained)](https://github.com/LeaVerou/regexplained)] - **Best tester for presentations** (JavaScript). **Command line** - [pcre2test](https://pcre2project.github.io/pcre2/doc/pcre2test/) - Includes regex debugger. Flavor: PCRE. - [rxrx](https://metacpan.org/dist/Regexp-Debugger/view/bin/rxrx) - Includes regex debugger ([video intro](https://www.youtube.com/watch?v=zcSFIUiMgAs)). Flavor: Perl. **By flavor** - fancy-regex (Rust library): [fancy-regex playground](https://fancy-regex.github.io/fancy-regex/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/fancy-regex/fancy-regex) ![GitHub last commit](https://img.shields.io/github/last-commit/fancy-regex/fancy-regex)](https://github.com/fancy-regex/fancy-regex/tree/main/playground)]. - JavaScript: [RegViz](http://regviz.org/). - .NET: [Regex Storm](http://regexstorm.net/tester) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/lonekorean/regex-storm) ![GitHub last commit](https://img.shields.io/github/last-commit/lonekorean/regex-storm)](https://github.com/lonekorean/regex-storm)]. - PCRE: [PHP Live Regex](https://www.phpliveregex.com/). - Python: [Pythex](https://pythex.org/). - Ruby: [Rubular](https://rubular.com/). - sed: [GNU sed REPL](https://sed.js.org/). - Swift: [Swift Regex](https://swiftregex.com/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/swiftfiddle/swiftregex) ![GitHub last commit](https://img.shields.io/github/last-commit/swiftfiddle/swiftregex)](https://github.com/swiftfiddle/swiftregex)] - Includes regex debugger, DSL builder. **Multiple flavors** - [CyrilEx](https://extendsclass.com/regex-tester.html) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/cyrilbois/cyrilex) ![GitHub last commit](https://img.shields.io/github/last-commit/cyrilbois/cyrilex)](https://github.com/cyrilbois/cyrilex)] - Java, JavaScript, MySQL, PHP, Python, Ruby. - [Patterns](https://krillapps.com/patterns/) (macOS, $3) - Bash, Emacs, grep, Java, Oniguruma, PCRE, POSIX BRE, POSIX ERE, Ruby, sed. - [RegexPlanet](https://www.regexplanet.com/) \[[*GitHub*](https://github.com/regexplanet)] - Go, Java, JavaScript (Bun, Deno, Node.js), .NET, Perl, PHP, PostgreSQL, Python, Ruby, Rust, Swift, Tcl, XRegExp.

Syntax-free regex builders

Build regexes without writing regex syntax or code.

✳️ Notable mentions
- [Regex Generator](https://regex-generator.olafneumann.org/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/noxone/regex-generator) ![GitHub last commit](https://img.shields.io/github/last-commit/noxone/regex-generator)](https://github.com/noxone/regex-generator)] - Generate simple regexes from a sample text. - [Regex.ai](https://regex.ai/) - Mark samples in a text and use AI to generate potential regexes.

Visualizers

Visualize how your regular expressions are structured or operate.

✳️ Notable mentions
- [Regex Nodes](https://johannesvollmer.com/regex-nodes/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/johannesvollmer/regex-nodes) ![GitHub last commit](https://img.shields.io/github/last-commit/johannesvollmer/regex-nodes)](https://github.com/johannesvollmer/regex-nodes)] - Graphical editor with visual hierarchy. Flavor: JavaScript. - [Debuggex](https://www.debuggex.com/) - Create railroad diagrams. Flavors: JavaScript, PCRE, Python. - [Regexper](https://regexper.com/) \[[*GitLab*](https://gitlab.com/javallone/regexper-static)] - Create railroad diagrams. Flavor: JavaScript.

Grep-like tools

Search and replace through files.

Command line

➕ See also: Feature comparison of grep-like tools.

GUI

Tutorials

Learn how to use regular expressions.

Traditional

✳️ Notable mentions
- [RexEgg](https://rexegg.com/) - Detailed tutorial with advanced topics. - [learnbyexample](https://learnbyexample.github.io/books/) \[[*GitHub*](https://github.com/learnbyexample)] - Ebooks on regexes ([JavaScript](https://learnbyexample.github.io/learn_js_regexp/), [Python](https://learnbyexample.github.io/py_regular_expressions/), [Ruby](https://learnbyexample.github.io/Ruby_Regexp/)) and command line text processing. - [Regular Expressions for Regular Folk](https://refrf.dev/) \[[*GitHub* ![GitHub Repo Stars](https://img.shields.io/github/stars/shreyasminocha/regex-for-regular-folk) ![GitHub last commit](https://img.shields.io/github/last-commit/shreyasminocha/regex-for-regular-folk)](https://github.com/shreyasminocha/regex-for-regular-folk)] - Visual, example-based ebook for beginners.

With interactive exercises

Videos

Regex engines

Major regex implementations, built into programming languages or as standalone libraries.

Documentation

Official regex references and guides.

Regex flavors

ℹ️ Raku (formerly Perl 6) reimagines regexes. See: Grammars (tutorial), Regexes (best practices).

Without own flavor

Source code

Read or contribute to the code behind major regex implementations.

Flavor differences

Syntax and behavior differences between regex flavors.

Performance

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 mentions
- [Performance of Regular Expressions](https://medium.com/textmaster-engineering/performance-of-regular-expressions-81371f569698) - On backtracking performance, with detailed examples.

Regex engine optimization

Benchmarking

ReDoS checkers

⚠️ These tools have limitations on supported syntax.

Collections of patterns

Prewritten regexes for specific tasks.

⚠️ Word of warning
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 libraries

Open source JavaScript libraries for advanced regex use and processing.

Alternative regex builders and engines

Abstracted regex syntax

Regex processors, utilities, and more

JavaScript regex evolution

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.

Editions from ES2019 onward have added additional Unicode properties that can be used via \p{…} and \P{…}. ES2021 added string method replaceAll GitHub Repo Stars GitHub last commit, although the only difference from ES3’s replace when given a regex is that it throws if not using flag g.

➕ See also
- [*Regexes Got Good: The History And Future Of Regular Expressions In JavaScript*](https://www.smashingmagazine.com/2024/08/history-future-regular-expressions-javascript/) - Backcompat libraries: [regexpu ![GitHub Repo Stars](https://img.shields.io/github/stars/mathiasbynens/regexpu) ![GitHub last commit](https://img.shields.io/github/last-commit/mathiasbynens/regexpu)](https://github.com/mathiasbynens/regexpu), [regenerate ![GitHub Repo Stars](https://img.shields.io/github/stars/mathiasbynens/regenerate) ![GitHub last commit](https://img.shields.io/github/last-commit/mathiasbynens/regenerate)](https://github.com/mathiasbynens/regenerate) ([Unicode property sets ![GitHub Repo Stars](https://img.shields.io/github/stars/mathiasbynens/regenerate-unicode-properties) ![GitHub last commit](https://img.shields.io/github/last-commit/mathiasbynens/regenerate-unicode-properties)](https://github.com/mathiasbynens/regenerate-unicode-properties)). - Chrome's `l` (`linear`) regex flag, behind a V8 flag \[[*explainer*](https://v8.dev/blog/non-backtracking-regexp)] \[[*how to run*](https://www.chromium.org/developers/how-tos/run-chromium-with-flags/)]. - [Can I use](https://caniuse.com/) - Up-to-date browser support tables for individual features.
🔮 Future: Active proposals
- [Extended mode and comments ![GitHub Repo Stars](https://img.shields.io/github/stars/tc39/proposal-regexp-x-mode) ![GitHub last commit](https://img.shields.io/github/last-commit/tc39/proposal-regexp-x-mode)](https://github.com/tc39/proposal-regexp-x-mode) (2021) - Flag `x` (`extended`) with insignificant whitespace and line comments (`#…`), plus inline comments via `(?#…)`. - [Atomic operators ![GitHub Repo Stars](https://img.shields.io/github/stars/tc39/proposal-regexp-atomic-operators) ![GitHub last commit](https://img.shields.io/github/last-commit/tc39/proposal-regexp-atomic-operators)](https://github.com/tc39/proposal-regexp-atomic-operators) (2021) - Atomic groups via `(?>…)` and possessive quantifiers (ex: `*+`, `++`). - [Buffer boundaries ![GitHub Repo Stars](https://img.shields.io/github/stars/tc39/proposal-regexp-buffer-boundaries) ![GitHub last commit](https://img.shields.io/github/last-commit/tc39/proposal-regexp-buffer-boundaries)](https://github.com/tc39/proposal-regexp-buffer-boundaries) (2021) - Anchors `\A` and `\z`, not affected by flag `m`. - [\R escape ![GitHub Repo Stars](https://img.shields.io/github/stars/tc39/proposal-regexp-r-escape) ![GitHub last commit](https://img.shields.io/github/last-commit/tc39/proposal-regexp-r-escape)](https://github.com/tc39/proposal-regexp-r-escape) (2021) - Outside character classes, `\R` matches any line terminator. - [Restrict subclassing support in built-ins ![GitHub Repo Stars](https://img.shields.io/github/stars/tc39/proposal-rm-builtin-subclassing) ![GitHub last commit](https://img.shields.io/github/last-commit/tc39/proposal-rm-builtin-subclassing)](https://github.com/tc39/proposal-rm-builtin-subclassing) (2020) - Scaled back `RegExp` subclassing. - [Legacy RegExp features ![GitHub Repo Stars](https://img.shields.io/github/stars/tc39/proposal-regexp-legacy-features) ![GitHub last commit](https://img.shields.io/github/last-commit/tc39/proposal-regexp-legacy-features)](https://github.com/tc39/proposal-regexp-legacy-features) (2015) - Standardization of legacy features.

Books

A curated list of regex books.

Articles

A curated list of regex articles.

Communities

Discuss, assist, and get help with regular expressions.

Miscellaneous

Other interesting, fun, and useful stuff.

About

Awesome Regex was created by Steven Levithan and contributors GitHub Repo Stars GitHub last commit.

Sponsors and backers

Past sponsors

If you want to support this project, I’d love your help by contributing improvements, sharing it with others, or sponsoring GitHub Repo Stars GitHub last commit ongoing development.

© 2024–present. CC BY 4.0.