awesome-regex
by slevithan
Curated collection of awesome regex tools, tutorials, libraries, etc.
AI summary
Regex resource
A curated collection of regular expression tools and resources.
- stars
- 260
- forks
- 8
- watching
- 8
- entries
- 139
What's in the list
139 links in 34 sections, with live GitHub stats.activeno commit in 2y
Testers
- RegexBuddy
( , $40) -
- RegExr
[ ] -
Testers / RegExr
- fork
Languages: ๐บ๐ธ, ๐จ๐ณ ( )
Testers
- RegexLearn
[ ] - (JavaScript)
- regexplained
[ ] - (JavaScript)
- RegViz
JavaScript:
- Regex Storm
.NET: [ ]
- PHP Live Regex
PCRE:
- Pythex
Python:
- Rubular
Ruby:
- GNU sed REPL
sed:
- CyrilEx
[ ] - Java, JavaScript, MySQL, PHP, Python, Ruby
- Patterns
( , $3) - Bash, Emacs, grep, Java, Oniguruma, PCRE, POSIX BRE, POSIX ERE, Ruby, sed
- RegexPlanet
[ ] - Go, Haskell, Java, JavaScript, .NET, Perl, PHP, PostgreSQL, Python, Ruby, Tcl, XRegExp
Syntax-free regex builders
- ChatGPT
(and other LLMs) - Ex:
- RegexMagic
( , $40) - Generate regexes using samples and rules
- Regex Generator
[ ] - Generate simple regexes from a sample text
- Regex.ai
Mark samples in a text and use AI to generate potential regexes
Visualizers
- Regex Vis
[ ] - Create railroad diagrams, with visual editor. Flavor: JavaScript
- Regulex
[ ] - Create railroad diagrams. Flavor: JavaScript
- Nodexr
[ ] - Graphical editor with visual hierarchy. Flavor: .NET
- Regex Nodes
[ ] - Graphical editor with visual hierarchy. Flavor: JavaScript
- Debuggex
Create railroad diagrams. Flavors: JavaScript, PCRE, Python
- Regexper
[ ] - Create railroad diagrams. Flavor: JavaScript
Grep-like tools / Command line
ripgrep
Better and faster grep. Recursively searches directories while respecting gitignore rules and skipping hidden/binary files
Grep-like tools / GUI
- Aba Search and Replace
( , $30) - Displays matches as you type
- PowerGREP
( , $159) - Can search through archives, binary files, PDFs, docs/sheets, emails, etc., via its GUI or the command line
PowerRename
( ) - Rename files using regexes
Tutorials / Traditional
- Regular-Expressions.info
Covers numerous regex flavors
- The Modern JavaScript Tutorial: Regular expressions
[ ] - Guide to using regexes in JavaScript
Tutorials / Traditional / The Modern JavaScript Tutorial: Regular expressions
- others
Languages: ๐บ๐ธ, ๐ช๐ธ, ๐ซ๐ท, ๐ฎ๐น, ๐ฏ๐ต, ๐ท๐บ, ๐บ๐ฆ, ๐จ๐ณ (partial for )
Tutorials / Traditional
- RexEgg
Detailed tutorial with advanced topics
- learnbyexample
[ ] - Ebooks on regexes ( , , ) and command line text processing
- Regular Expressions for Regular Folk
[ ] - Visual, example-based ebook for beginners
Tutorials / With interactive exercises
- RegexLearn
[ ] - Interactive tutorial and practice problems
- RegexOne
Interactive tutorial and practice problems
Tutorials / Videos
- Demystifying Regular Expressions
Great presentation for beginners, by Lea Verou at HolyJS 2017 (1hr 12m)
- Learn Regular Expressions In 20 Minutes
Live syntax walkthrough in a regex tester, by Kyle Cook
- Udemy
Many options for video courses are available on ($)
Documentation
- Manual
Boost.Regex:
- Introduction
Hyperscan:
- Pattern
Java: ,
- RegExp
JavaScript: , , ,
- Overview
.NET: , ,
RE
Onigmo:
RE
Oniguruma:
- Pattern
PCRE2: ,
- Syntax
Perl: , ,
- re
Python:
Syntax
RE2:
- regex
Rust: ,
- regexp
Go: - Flavor: RE2
- Regular Expressions
MySQL: - Flavor: ICU
- Regular Expressions
PHP: - Flavor: PCRE
- Regexp
Ruby: - Flavor: Onigmo
- NSRegularExpression
Swift: - Flavor: ICU
Source code
Boost.Regex
Popular C++ regex library
Hyperscan
Intel's high-performance library, used for
ICU
Unicode org's package with full Unicode support
Java: java.util.regex
JDK standard regexes
Source code / JavaScript:
JavaScriptCore: RegExp
Regex engine used by Safari
V8: Irregexp
Regex engine used by Chrome, Edge, , etc
Source code
.NET: System.Text.RegularExpressions
Shared by all .NET languages (C#, VB, etc.)
Onigmo
Forked from Oniguruma. Used by Ruby 2.0+
Oniguruma
Popular C regex library used by Ruby 1.9, TextMate grammars, etc
PCRE2
Popular C regex library used by PHP, R, etc
Perl
See
Python: re
and - Standard and extended regex libraries
RE2
Popular C++ regex library used by Go, etc. Non-backtracking engine
Rust: regex
Non-backtracking engine
Flavor differences
- Regular Expression Feature Comparisons
Ron Buckton: [ ]
- Tools & Languages
Regular-Expressions.info:
- Named capture
Steven Levithan: ,
- Comparison of regular expression engines
Wikipedia:
Performance / Crafting efficient regexes
- Runaway Regular Expressions: Catastrophic Backtracking
Exploration and solutions for superlinear backtracking
- Performance of Greedy vs. Lazy Regex Quantifiers
Illustrates the mechanics of backtracking
- Performance of Regular Expressions
On backtracking performance, with detailed examples
Performance / Regex engine optimization
- Regular Expression Matching Can Be Simple And Fast
On non-backtracking engines. A includes comparisons of RE2 and PCRE performance
- Regular Expression Improvements in .NET 7
and - Includes detailed explanations of performance optimizations
- ripgrep is faster than {grep, โฆ}
Includes details about what makes ripgrep and Rust's fast
Performance / Benchmarking
rebar
Cross-engine benchmarking libraries: ,
- Boost.Regex: Performance
Compares Boost, C++ , and others
Performance / ReDoS checkers
- regex.rip
Test a regex for ReDoS vulnerability
recheck
[ ] - JavaScript and Scala library for detecting ReDoS vulnerability. Can be used as an ESLint plugin
vuln-regex-detector
Perl library for detecting ReDoS vulnerability
Collections of patterns
- Book: Regular Expressions Cookbook, 2nd Edition
(2012) - High-quality solutions with detailed explanations
- Regex DB
Solutions include basic descriptions and examples of matching and non-matching text
JavaScript regex libraries / Alternative regex builders and engines
Regex+
A template tag for extended, readable, high-performance JavaScript regexes
Oniguruma-To-ES
Convert Oniguruma patterns to native JavaScript regexes
XRegExp
[ ] - Extended regex syntax, flags, and utils; useful for backcompat
incr-regex-package
Partial/incremental matching, used by for input validation with a regex mask
node-re2
Use other engines via WASM bindings: (RE2), (Rust's ), (Oniguruma)
JavaScript regex libraries / Abstracted regex syntax
Rexx
A template tag that uses structured syntax with variables and comments
Melody
[ ] - A language that compiles to regexes
compose-regexp.js
Compose with functions: , (implementations for ), [ ], [ ]
JavaScript regex libraries / Regex processors
regexpp
AST builders: (used by ESLint), (includes optimizer, etc.), /
JavaScript regex libraries / Regex processors / regexpp
- AST Explorer: RegExp
View ASTs generated by regexp-tree, regexpp, and regjsparser
regexp-ast-analysis
[ ] - Analyze AST nodes produced by regexpp
JavaScript regex libraries / Regex processors
Regex Colorizer
Highlight regex syntax: [ ],
eslint-plugin-regexp
Find regex mistakes and improvements: [ ],
randexp.js
Generate strings that match a given regex: ,
regexgen
Generate a regex from given strings:
JavaScript regex evolution
JavaScript regex evolution / explainer
- explainer
Flag ( ) [ ] [ ], which adds Unicode code point escapes via , strict errors (for unreserved escapes, octal escapes, quantified lookahead, and unescaped special characters in some contexts), Unicode case-folding for flag , and code point matching (with impact on quantifiers, character classes, ranges, and built-in sets)
JavaScript regex evolution
flag s
ES2018 added ( ), , , and (via and which require flag ; see )
matchAll
ES2020 added string method (which returns an iterator), plus
flag d
ES2022 added ( ), which provides start/end indices for matched substrings
flag v
ES2024 added ( ) [ ] as an upgrade to flag , which adds a set of multicharacter "properties of strings" to , multicharacter elements within character classes via and , nested character classes, set operators and , and different escaping rules within character classes. It also fixes case-insensitive matching for and within negated
regexpu
Backcompat libraries: , ( )
- explainer
Chrome's ( ) regex flag, behind a V8 flag [ ] [ ]
- Can I use
Up-to-date browser support tables for individual features
Duplicate named capturing groups
(2022) - Ex:
Extended mode and comments
(2021) - Flag ( ) with insignificant whitespace and line comments ( ), plus inline comments via
Pattern modifiers
(2021) - Ex: , ,
Atomic operators
(2021) - Atomic groups via and possessive quantifiers (ex: , )
Buffer boundaries
(2021) - Anchors and , not affected by flag
\R escape
(2021) - Outside character classes, matches any line terminator
Restrict subclassing support in built-ins
(2020) - Scaled back subclassing
RegExp escaping
(2015) -
Legacy RegExp features
(2015) - Standardization of legacy features
Books
- Regular Expressions Cookbook, 2nd Edition
(2012) by Jan Goyvaerts and Steven Levithan - Regex tutorial with code samples for eight programming languages, 100+ regex recipes for practical problems, and a deep focus on cross-flavor differences
- Mastering Regular Expressions, 3rd Edition
(2006) by Jeffrey Friedl - A computer science classic, best for people who already know the basics. Includes good coverage of crafting efficient regexes
- Introducing Regular Expressions
(2012) by Michael Fitzgerald - An intro for programmers new to regular expressions that sticks to the basics
Articles
- The World's Shortest Regex Compiler?
and a on optimization - Introduction to writing a non-backtracking regex engine (in JavaScript)
- Regex Legends: The People Behind the Magic
Influential people behind the technology
- Fun With .NET Regex Balancing Groups
Advanced usage of a .NET-only regex feature
Communities
Miscellaneous
- Regex
Chrome extension: - Regex search on webpages via
- regex101 Regex Quiz
Quiz: - Requires sign-in
- Regex Crossword
Games: , , ($)
- xkcd
Comics: ,
Nothing in this list matches your filter.