websystemer / 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
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.
More tools
- JSON FormatterFormat, validate, minify and sort JSON.
- Base64Encode and decode text, with URL-safe and UTF-8 support.
- URL EncoderPercent-encode, decode and take apart URLs and query strings.
- JWT DecoderRead the header, payload and expiry of a JSON Web Token.
- Timestamp ConverterUnix time to dates and back, in any time zone.
- Cron ExplainerPlain-English meaning and the next run times of a cron schedule.
- Color ToolsConvert HEX, RGB and HSL, and check WCAG contrast.