Loading…
Loading…
Paste a regular expression and get a plain-English explanation of every part — groups, quantifiers, character classes, lookarounds, and backreferences — as a step-by-step tree.
Also covers: Regular expression explainer · Explain regex · Regex to English
Explanation
Enter a regular expression and each part is explained here, in order, as a tree.
Want to see it match? Paste the pattern into the Regex Tester.
Paste a regex or a whole literal like /^\d{3}-\d{4}$/i, or pick an example. Set the flags it uses, since i, m, and s change what parts mean.
Each part is explained in order, with nested groups and alternatives indented under their parent. Runs of plain characters are combined into one readable piece of text.
JavaScript (ECMAScript 2018+) regular expressions: groups, named groups, lookahead and lookbehind, backreferences, lazy quantifiers, and Unicode property escapes like \p{L} with the u flag. The v flag's set notation isn't supported yet.
A greedy quantifier (*, +, {2,}) matches as much as it can, then gives back characters if the rest of the pattern fails. A lazy one (*?, +?) matches as little as possible. In <.+> on "<a><b>", greedy matches the whole string and lazy matches just <a>.
They check what comes after (?=…) or before (?<=…) the current position without including it in the match. (?!…) and (?<!…) require that it does not match. For example, \d+(?=px) matches 12 in "12px" but not in "12em".
No. It's parsed in your browser with the regexp-tree library and never leaves the page.
Data
Format, validate, and minify JSON in your browser. Paste it, upload a file, or load it from a URL. Errors show the exact line and column.
C# / .NET
Paste JSON and get C# model classes or records, ready for System.Text.Json or Newtonsoft.Json. Nested objects, arrays, nullable types, dates, and GUIDs are inferred for you.
SQL
Format and beautify SQL queries for SQL Server (T-SQL), PostgreSQL, MySQL, Oracle, and more. Set the indentation, keyword case, and layout, and get the exact line of any syntax error.
Data
Format, validate, and minify XML (config files, .csproj, SOAP, RSS) in your browser. Entities, CDATA, and mixed content are kept exactly as written, and errors show the line and column.
Data
Format and validate YAML (docker-compose, Kubernetes, GitHub Actions) without losing comments, or convert YAML to JSON. Errors show the exact line and column.
Web
Beautify HTML pages and fragments without changing how they render. Inline spacing, <pre>, and scripts stay intact, and embedded CSS and JavaScript can be formatted too.