Regex Syntax Reference
Browse regex syntax topics; each page has a runnable example and engine differences.
Verified Each verified example was run in JavaScript, Python re, PCRE2-8 and Go regexp, unless its card names other engines.
-
Learn how ^ and $ anchor a match, and how the m flag changes them to line starts and ends.
Open in workbench — Regex Anchors^cat$ -
Learn how a character class matches one character from a set, with a runnable example.
Open in workbench — Regex Character Classes[A-F0-9]{2} -
Learn how greedy and lazy quantifiers repeat, with a runnable example.
Open in workbench — Regex Quantifiersa+? -
Learn how capture groups number their parts and keep values as strings.
Open in workbench — Regex Capture Groups([A-Z]{2})-(\d{3}) -
Learn named groups and why their syntax differs between JavaScript, Python, PCRE2 and Go.
Open in workbench — Regex Named Groups(?<id>TX-\d{5}) -
Learn lookahead and lookbehind, and which engines support them.
(?<=ID=)\d+JavaScript · This browserPython re · Local WASMPCRE2-8 · Local WASMOpen in workbench — Regex Lookaround -
Learn what regex flags change, and which flags each engine accepts.
Open in workbench — Regex Flagscat -
Learn how to escape special characters, and why JSON source needs a second backslash.
Open in workbench — Regex Escaping\.
No page matches.