1 β Anchors, Quantifiers & Character Classes
Build a solid foundation. This guide covers ^, $, \b, and the difference between greedy, lazy, and possessive quantifiers. Includes exercises for matching Dutch postal codes (e.g., 1071 XX) and phone numbers in +31 6 1234 5678 format.
Read Guide
2 β Capturing Groups & Named Subpatterns
Learn to extract structured data using numbered and named captures. Parse log lines like [2024-03-15T08:42:11Z] INFO Request handled in 234ms into timestamp, level, and message variables. Covers backreferences and non-capturing groups (?:β¦).
Read Guide
3 β Lookarounds: Positive & Negative Assertions
Match context without consuming characters. Use positive lookbehind <?= to find prices preceded by "EUR", and negative lookahead (?!β¦) to exclude reserved usernames. Practical examples with CSV field parsing and HTML attribute extraction.
Read Guide
4 β Validating Email Addresses
A realistic email validation pattern that covers RFC 5322 essentials without going overboard. Handles jan+filter@voorbeeld.nl, subdomains like user@mailserver.example.com, and rejects common mistakes such as missing TLDs or consecutive dots.
Read Guide
5 β Parsing CSV & Delimited Data
Extract fields from comma-separated and pipe-delimited files. Handles quoted fields with embedded commas (e.g., "Amsterdam, Noord-Holland"), escaped quotes, and inconsistent whitespace. Includes a benchmark comparing regex vs. native CSV parsers.
Read Guide
6 β Sanitizing User Input
Defensive regex for stripping HTML tags, neutralizing XSS payloads, and normalizing whitespace. Covers patterns for safe username generation, slug creation from Dutch text (handling Γ©, ij, Γ―), and preventing regex denial-of-service (ReDoS) in production.
Read Guide