Regular expression tester
Enter a regular expression and sample text to highlight matches, inspect captured groups and preview replacements.
The table displays up to the first 500 matches.
$1, $2… refer to groups, $<name> to a named group, $& to the entire match, and $$ to a literal $. Without g, only the first match is replaced.
JavaScript syntax
Pattern explanation
Development & web
TextRemove duplicate linesPaste a list to keep the first occurrence of each line and see how many duplicates were removed.TextFind and replace text in bulkApply a list of find-and-replace rules to a passage in order and see how many matches each rule changed.Development & webFormat and validate JSONPaste JSON to indent it or fit it on one line, and locate invalid syntax by its line and column.Development & webSQL formatterPaste a SQL query to indent clauses such as JOIN and WHERE on separate lines or compact the query onto one line.