fjordtools / Text / Regex Tester

Regex Tester

Test JavaScript regular expressions with live highlighting, capture groups and a replace preview. Runs in your browser.

Pattern
Test string
Matches highlighted

      
Match list
Replace with

      
About Regex Testerhow it works and good to know

JavaScript flavor

This tester uses your browser's regular expression engine, so it behaves exactly like RegExp in JavaScript and Node. Lookbehind, named groups ((?<year>\d{4})) and Unicode property escapes work in current browsers.

Replacing

In the replacement, $1 inserts the first capture group, $& the whole match and $<name> a named group.

Runaway patterns

Matching runs in a background worker. If a pattern takes longer than 1.5 seconds, for example through catastrophic backtracking, it is stopped and you get a warning instead of a frozen tab.

Related tools