Regex terms
Regular expressions are a compact language for describing patterns in text — extraordinarily powerful, notoriously hard to read, and present in virtually every programming language. This category covers syntax, anchors, groups, lookaheads, quantifiers, and the performance traps like catastrophic backtracking that turn a useful pattern into a production incident.
More on Regex
History
Regular expressions originated in the 1950s from Stephen Cole Kleene's mathematical work on finite automata and formal language theory, formalized in his notation for describing regular languages. The concept was first implemented practically in Unix tools during the 1970s, particularly in grep and sed, where it became foundational to text processing. The syntax evolved significantly with the introduction of extended regular expressions (ERE) and later Perl-Compatible Regular Expressions (PCRE) in the 1990s, which added powerful features like lookahead, lookbehind, and named capture groups. Today, regex remains essential across programming languages—JavaScript, Python, PHP, Java, and others—each with dialect variations, while modern practice emphasizes performance awareness (catastrophic backtracking risks) and Unicode support for international text. The field continues to balance expressive power with maintainability, as regex patterns grow more complex in real-world applications like validation, parsing, and log analysis.
Key concepts
- Regex Syntax
- Regex Flags & Modifiers
- Anchors & Word Boundaries
- Greedy vs Lazy Quantifiers
- Capture Groups & Backreferences
- Lookahead & Lookbehind
- Common Regex Patterns
- Regex Performance
Best references
-
Regular Expressions - ECMAScript Specification The official ECMA-262 standard defines JavaScript regex behavior. Essential for understanding JS-specific regex features, flags, and edge cases.
-
PCRE - Perl Compatible Regular Expressions The canonical PCRE library documentation. Critical reference for advanced features like lookahead/lookbehind, named groups, and conditional patterns used across PHP, Python, and other languages.
-
Regular Expressions - MDN Web Docs Practical, well-maintained guide to JavaScript regex syntax, quantifiers, character classes, and common patterns with runnable examples.
-
Mastering Regular Expressions by Jeffrey Friedl The definitive book on regex theory and practice. Covers engine behavior, catastrophic backtracking, performance optimization, and implementation details across multiple languages.
-
Unicode Regular Expressions - Unicode Consortium Technical Report 18 defines Unicode support in regex engines. Essential for understanding multibyte characters, case folding, and modern Unicode-aware regex features.
-
Regular Expressions - Python Documentation Python's `re` module documentation with detailed syntax reference, including flags, grouping, and lookahead/lookbehind. Exemplifies standard regex behavior across implementations.
Typed relationships here
Edges touching a Regex term.
- Greedy vs Lazy Quantifiers Enables Catastrophic Backtracking Jun 13
- Regex Flags & Modifiers Enables Unicode & Multibyte Regex Jun 9
- Catastrophic Backtracking Often seen in PCRE in PHP Jun 9
- Named Capture Groups Specializes Capture Groups & Backreferences Jun 7
- Regex Branch Reset Groups Specializes Capture Groups & Backreferences Jun 7