Loadingβ¦
Loadingβ¦
Test JavaScript regular expressions against your text with live match highlighting, capture groups, named groups, and find-and-replace. Runaway patterns are stopped instead of freezing the page.
Also covers: Regular expression tester Β· Regex checker Β· Regex replace
Enter a pattern
Matches are highlighted here.Type a pattern between the slashes, or paste a whole literal like /\d+/g and the flags are filled in. Set flags such as g (all matches), i (ignore case), and m (multiline).
Paste or drop the text to search. Matches are highlighted as you type, and the table lists each match with its position and capture groups.
Tick Replace and use $1, $<name>, or $& in the replacement to preview the result of String.replace, then copy it.
JavaScript's (ECMAScript), run by your browser β the same engine as Node.js and Chrome. Most syntax matches PCRE, Python, and .NET, but lookbehind support, Unicode classes, and some escapes differ between languages.
Some patterns, like (a+)+ or (.*)*, take exponentially long on text that almost matches (catastrophic backtracking). Matching runs in a background worker that's stopped after 2 seconds, so the page never freezes. The same pattern could hang a server, so fix it by removing nested quantifiers.
Without the g (global) flag, a JavaScript regex finds only the first match, and replace only replaces the first occurrence. Tick g to find them all.
Up to 5,000 matches are found and the first 500 are listed in the table.
No. Everything runs in your browser tab, and nothing you paste or open is uploaded or stored.
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.