Learn Regular Expressions
12 interactive lessons covering everything from basic literals to performance optimization. Each lesson takes 5–10 minutes.
Introduction to Regular Expressions
Learn what regex patterns are and how literal characters match text exactly.
5 min2 examplesLiterals and Escaping Special Characters
Some characters have special meanings in regex. Learn how to match them literally with backslash escaping.
5 min2 examplesCharacter Classes
Match any single character from a defined set using square brackets.
7 min3 examplesAnchors
Match positions in a string rather than characters, for precise boundary control.
6 min3 examplesQuantifiers
Control how many times a pattern element must appear.
7 min3 examplesCapturing Groups
Use parentheses to group patterns and capture matched text for later use.
8 min2 examplesNon-Capturing Groups
Group patterns for structure without creating numbered capture references.
6 min2 examplesLookarounds
Assert context around a match without including that context in the result.
9 min2 examplesNamed Capture Groups
Give capture groups descriptive names to make complex patterns readable and maintainable.
7 min2 examplesCommon Real-World Patterns
Combine all the concepts you've learned to build patterns for common real-world use cases.
10 min2 examplesRegex Flags
Flags modify global matching behavior — case sensitivity, multiline anchors, and more.
6 min2 examplesPerformance and ReDoS
Understand catastrophic backtracking and write safe, efficient patterns.
8 min2 examples