Skip to content
My Blog

Search WPDesignVault

Try "image", "json", "schema" or "contrast". Use arrow keys to move through results.

Developer Tools

Regex Tester

Test JavaScript regular expressions against your text with highlighted matches, capture groups and a live replace preview.

Runs in your browser. Nothing you enter is uploaded. Last updated
Flags
Highlighted matches
Matches
#MatchIndexGroups

How to use

  1. Enter a pattern without the surrounding slashes and choose flags.
  2. Paste test text. Matches are highlighted and listed with their groups.
  3. Optionally enter a replacement ($1, $) to preview the result.

What this tool does

Patterns run with your browser’s JavaScript regex engine in a separate Web Worker. If a pattern takes longer than two seconds, for example because of catastrophic backtracking, the worker is stopped and you get a warning instead of a frozen tab.

Tips

  • PHP (PCRE), Python and JavaScript regex are similar but not identical; lookbehind and named groups vary.
  • Nested quantifiers like (a+)+ can be extremely slow on non-matching input.

Frequently asked questions

Which regex flavour is this?

ECMAScript (JavaScript), as implemented by your browser. Most everyday syntax is shared with PHP's preg functions.

JSON Validator

Check whether JSON is valid and find the exact line and column of any syntax error.

Remove Duplicate Lines

Delete repeated lines from any list, with options to ignore case and surrounding spaces, remove empty lines and…

UUID Generator (v4)

Generate one or up to 1,000 random v4 UUIDs at once, with uppercase, no-hyphen and brace options.

URL Encoder / Decoder

Encode or decode URLs and query values with percent-encoding, and inspect a URL's host, path and parameters.

Unix Timestamp Converter

Convert Unix epoch timestamps to readable dates in UTC and your local time zone, or turn a date…

JSON Minifier

Remove all unnecessary whitespace from JSON and see how many bytes you save.

JSON Formatter & Beautifier

Pretty-print JSON with your choice of indentation and optional key sorting. Errors are shown with line and column.…