awesome-regex
Regex resource
A curated collection of regular expression tools and resources.
Curated collection of awesome regex tools, tutorials, libraries, etc.
260 stars
8 watching
8 forks
last commit: about 1 year ago awesomeawesome-listregexregexpregular-expression
Testers | |||
| regex101 | |||
| 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 | 49,203 | about 1 year ago | 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 | 112,309 | 12 months ago | ( ) - 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 ($) | ||
Regex engines / Documentation | |||
| Manual | Boost.Regex: | ||
| Regular expressions library | C++: | ||
| Introduction | Hyperscan: | ||
| Regular Expressions | ICU: | ||
| Pattern | Java: , | ||
| RegExp | JavaScript: , , , | ||
| Overview | .NET: , , | ||
| RE | 625 | over 1 year ago | Onigmo: |
| RE | 2,331 | about 1 year ago | Oniguruma: |
| Pattern | PCRE2: , | ||
| Syntax | Perl: , , | ||
| re | Python: | ||
| Syntax | 9,023 | 12 months ago | 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 | ||
Regex engines / Source code | |||
| Boost.Regex | 86 | 12 months ago | Popular C++ regex library |
| Hyperscan | 4,857 | over 1 year ago | Intel's high-performance library, used for |
| ICU | 2,870 | 12 months ago | Unicode org's package with full Unicode support |
| Java: java.util.regex | 20,082 | 12 months ago | JDK standard regexes |
Regex engines / Source code / JavaScript: | |||
| JavaScriptCore: RegExp | 8,165 | 12 months ago | Regex engine used by Safari |
| V8: Irregexp | 23,582 | 12 months ago | Regex engine used by Chrome, Edge, , etc |
Regex engines / Source code | |||
| .NET: System.Text.RegularExpressions | 15,518 | 12 months ago | Shared by all .NET languages (C#, VB, etc.) |
| Onigmo | 625 | over 1 year ago | Forked from Oniguruma. Used by Ruby 2.0+ |
| Oniguruma | 2,331 | about 1 year ago | Popular C regex library used by Ruby 1.9, TextMate grammars, etc |
| PCRE2 | 925 | 12 months ago | Popular C regex library used by PHP, R, etc |
| Perl | 1,999 | 12 months ago | See |
| Python: re | 64,132 | 12 months ago | and - Standard and extended regex libraries |
| RE2 | 9,023 | 12 months ago | Popular C++ regex library used by Go, etc. Non-backtracking engine |
| Rust: regex | 3,580 | about 1 year ago | Non-backtracking engine |
Regex engines / 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 | ||
| Book: High Performance JavaScript | (2010) - | ||
| Book: Mastering Regular Expressions, 3rd Edition | (2006) - | ||
| 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 | 233 | about 1 year ago | Cross-engine benchmarking libraries: , |
| Boost.Regex: Performance | Compares Boost, C++ , and others | ||
Performance / ReDoS checkers | |||
| regex.rip | Test a regex for ReDoS vulnerability | ||
| recheck | 256 | 12 months ago | [ ] - JavaScript and Scala library for detecting ReDoS vulnerability. Can be used as an ESLint plugin |
| vuln-regex-detector | 320 | almost 4 years ago | 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+ | 521 | about 1 year ago | A template tag for extended, readable, high-performance JavaScript regexes |
| Oniguruma-To-ES | 61 | 12 months ago | Convert Oniguruma patterns to native JavaScript regexes |
| XRegExp | 3,307 | about 1 year ago | [ ] - Extended regex syntax, flags, and utils; useful for backcompat |
| incr-regex-package | 13 | almost 2 years ago | Partial/incremental matching, used by for input validation with a regex mask |
| node-re2 | 505 | over 1 year ago | Use other engines via WASM bindings: (RE2), (Rust's ), (Oniguruma) |
JavaScript regex libraries / Abstracted regex syntax | |||
| Rexx | 2 | almost 2 years ago | A template tag that uses structured syntax with variables and comments |
| Melody | 4,638 | about 1 year ago | [ ] - A language that compiles to regexes |
| compose-regexp.js | 145 | about 1 year ago | Compose with functions: , (implementations for ), [ ], [ ] |
JavaScript regex libraries / Regex processors | |||
| regexpp | 24 | about 1 year ago | 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 | 3 | over 1 year ago | [ ] - Analyze AST nodes produced by regexpp |
JavaScript regex libraries / Regex processors | |||
| Regex Colorizer | 176 | over 1 year ago | Highlight regex syntax: [ ], |
| eslint-plugin-regexp | 701 | 12 months ago | Find regex mistakes and improvements: [ ], |
| randexp.js | 1,836 | almost 2 years ago | Generate strings that match a given regex: , |
| regexgen | 3,344 | almost 2 years ago | Generate a regex from given strings: |
JavaScript regex evolution | |||
| explainer | ES5 (2009) fixed unintuitive behavior by creating a new object every time regex literals are evaluated [ ], and allowed regex literals to use unescaped forward slashes within character classes ( ) | ||
| explainer | ES6/ES2015 added: [ ] | ||
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 | 88 | almost 4 years ago | ES2018 added ( ), , , and (via and which require flag ; see ) |
| matchAll | 99 | over 4 years ago | ES2020 added string method (which returns an iterator), plus |
| flag d | 65 | over 3 years ago | ES2022 added ( ), which provides start/end indices for matched substrings |
| flag v | 76 | about 2 years ago | 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 |
| Regexes Got Good: The History And Future Of Regular Expressions In JavaScript | |||
| regexpu | 234 | about 1 year ago | 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 | 28 | over 2 years ago | (2022) - Ex: |
| Extended mode and comments | 27 | about 4 years ago | (2021) - Flag ( ) with insignificant whitespace and line comments ( ), plus inline comments via |
| Pattern modifiers | 46 | about 1 year ago | (2021) - Ex: , , |
| Atomic operators | 17 | over 3 years ago | (2021) - Atomic groups via and possessive quantifiers (ex: , ) |
| Buffer boundaries | 7 | over 3 years ago | (2021) - Anchors and , not affected by flag |
| \R escape | 5 | almost 4 years ago | (2021) - Outside character classes, matches any line terminator |
| Restrict subclassing support in built-ins | 34 | over 1 year ago | (2020) - Scaled back subclassing |
| RegExp escaping | 375 | about 1 year ago | (2015) - |
| Legacy RegExp features | 41 | about 2 years ago | (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 | |||
| Reddit: r/regex | |||
| Stack Overflow: [regex] | |||
Miscellaneous | |||
| Regex | Chrome extension: - Regex search on webpages via | ||
| regex101 Regex Quiz | Quiz: - Requires sign-in | ||
| Regex Crossword | Games: , , ($) | ||
| xkcd | Comics: , | ||