Learn regex patterns from scratch with step-by-step explanations and interactive examples.
Validate email addresses, phone numbers, or URLs using regex patterns.
Extract specific text from larger strings using capturing groups and pattern matching.
Quickly reference a specific regex construct you encounter in code or documentation.
Learn-regex is a plain-text educational guide that teaches regular expressions from the ground up. A regular expression (often abbreviated \"regex\") is a pattern written in a special mini-language that lets you search for, match, validate, or extract text based on a description of what the text should look like, rather than spelling out the exact text you want. For example, instead of checking whether an email address is exactly \"[email protected]\", a regex lets you check whether any string follows the general form of an email address. The guide starts with the simplest concepts (matching literal text) and works systematically through every major building block: the dot that matches any character, character sets in square brackets that match one character from a group, repetition operators that control how many times a pattern repeats, anchors that require the match to start or end at a specific position, capturing groups that extract pieces of the match, and lookahead and lookbehind assertions that let you match text only when it is (or is not) preceded or followed by something specific. It also covers flags like case-insensitive mode and global mode. Each concept is explained with short examples that show a pattern and highlight what it matches in a sample sentence, with links to an interactive regex tester where you can experiment immediately. You would use this guide when first learning regex, it is structured to build understanding step by step rather than dump the full specification at once. It is also useful as a reference when you encounter a specific regex construct you have not seen before. The repository contains no programming code, it is a documentation-only project. It has been translated into over 15 languages and has no runtime dependencies.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.