WerklyTools
EN
Buy me a coffee

Regex tester (regular expressions)

Type a pattern and instantly see what matches in your text, with every capture group broken down. Switch to “Replace” mode to try substitutions with $1 or $<name>, and share your regex with a link.

Processed 100% in your browser

Highlighted matches
Quick reference (click to insert)

Ctrl + Enter runCtrl + C copy result

How to use

  1. 1Type the regular expression between the slashes or pick a preset (email, URL, IPv4, date…).
  2. 2Enable the flags you need: g, i, m, s, u or y.
  3. 3Paste your test string: matches are highlighted as you type.
  4. 4Check the groups table, or switch to “Replace” to see and copy the transformed text.

Use cases

  • Validate emails, phone numbers, postcodes or dates before using them in a form.
  • Extract data from logs, CSV or HTML without writing a script.
  • Prepare bulk find-and-replace for VS Code, sed or your JavaScript code.
  • Learn regex with the interactive cheat sheet and see what each token does.

Frequently asked questions

Which regex engine does it use?

Your browser’s native JavaScript RegExp engine, the same as in Node.js and every browser. Whatever works here will work the same in your JavaScript or TypeScript code.

What do the g, i, m, s, u and y flags mean?

g finds all matches; i ignores case; m makes ^ and $ work per line; s lets the dot match line breaks; u enables full Unicode mode; y (sticky) only matches from the current position.

How do I use groups in the replacement?

Write $1, $2… for numbered groups, $<name> for named groups and $& for the whole match. Without the g flag only the first match is replaced.

What if my regex hangs?

The regex runs in a Web Worker with a time limit. If a pattern causes catastrophic backtracking, it is stopped after 1.5 seconds without freezing the page and you are notified.

Is my text stored or sent anywhere?

No. Everything is processed in your browser. Only the pattern and flags are added to the URL so you can share them; your test string never leaves your device.

Related tools