Series

How Regular Expressions Works

From basics to real-world patterns

Regular expressions are the universal tool for matching patterns in text. They show up in every language, every editor, and every command-line tool. This series starts with the simplest building blocks — literal characters and the dot — and works up through character classes, quantifiers, groups, lookaround, and engine internals. The final article is a large cookbook of real-world patterns you can use and adapt.

How to read this series: Start from the top. Each article introduces new syntax that later articles build on. The final article is a standalone reference you can jump into at any time.
  1. 001
    Beginner Regular Expressions: The Basics

    Literals, metacharacters, and the dot

    7 min
  2. 002
    Beginner Character Classes

    Matching specific sets of characters

    6 min
  3. 003
    Beginner Quantifiers

    Controlling repetition — greedy, lazy, and possessive

    6 min
  4. 004
    Beginner Anchors & Boundaries

    Matching positions, not characters

    6 min
  5. 005
    Intermediate Groups & Alternation

    Capturing, structuring, and reusing parts of a match

    6 min
  6. 006
    Intermediate Lookaround Assertions

    Checking context without consuming characters

    6 min

Under the Hood & Practical Use

How regex engines work internally, and a large cookbook of real-world patterns.

  1. 007
    Advanced How Regex Engines Work

    NFA, DFA, backtracking, and performance

    9 min
  2. 008
    Intermediate Regex Examples

    A cookbook of real-world patterns

    12 min