Regex tester

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

Runs in your browser. Nothing you paste is uploaded. Uses JavaScript regular expressions.

3 matches
Exam on 14-12-2026, result by 30-01-2027. Last date: 05-12-2026
#MatchAt$1$2$3
114-12-2026814122026
230-01-20273030012027
305-12-20265305122026
Exam on 2026-12-14, result by 2027-01-30. Last date: 2026-12-05

How to use it

  1. Type your regular expression between the slashes, without the slashes themselves.
  2. Tick the flags you need: g for all matches, i to ignore case, m for line-by-line ^ and $, s so . matches new lines.
  3. Paste your test text; matches are highlighted and listed with their position and capture groups.
  4. Optionally type a replacement, using $1, $2 or $<name>, to preview the result of replace().

See exactly what your pattern matches

Regular expressions are powerful but easy to get subtly wrong. Testing against real sample text, with every match highlighted and every capture group listed, shows problems straight away: a greedy .* swallowing too much, an anchor that only works with the m flag, or a group you forgot to escape. The pattern runs on your browser's own JavaScript regex engine, so the results match what your JavaScript or TypeScript code will do.

The replace preview is handy for clean-up jobs such as reformatting dates (the default example turns 14-12-2026 into 2026-12-14), removing extra spaces or converting a list into code.

Differences between languages

Most syntax is the same in JavaScript, Python, Java, PHP and Go, but not all of it. Lookbehind, named groups and Unicode property escapes (\p{L}) differ between engines, and Go does not support backreferences. Test the final pattern in your own language too. Some patterns with nested repetition, like (a+)+, can take a very long time on certain text; if the page stops responding, simplify the pattern.

Questions

Which regex flavour is this?
JavaScript (ECMAScript), as used in browsers, Node.js and TypeScript.
How do I match a dot or bracket literally?
Escape it with a backslash: \. matches a dot, \( a bracket.
Why does ^ only match the first line?
Without the m flag, ^ and $ mean the start and end of the whole text. Turn on m to make them match at every line.
Is what I paste sent to a server?
No. The tool runs as JavaScript in your browser. Your text, files and keys stay on your device, so it is safe to use with internal data, tokens and customer records. It keeps working offline after the page has loaded once.

More free tools