How to use it
- Type your regular expression between the slashes, without the slashes themselves.
- Tick the flags you need: g for all matches, i to ignore case, m for line-by-line ^ and $, s so . matches new lines.
- Paste your test text; matches are highlighted and listed with their position and capture groups.
- 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.