← Tools

Regex Tester

Build, test and understand regular expressions as you type.

Private: your files never leave your device.

JavaScript regular expressions, as in browsers and Node.js. Matching runs on your device and stops a pattern that takes too long, so the page never freezes.

How it works

  1. Choose your files.
  2. Adjust the settings if you like.
  3. Download the result, or send it to another device with BroAllDone.

Frequently asked questions

How do I test a regular expression?

Type the expression and some text: every match is highlighted as you type, with a table of matches and their groups.

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

g finds every match, i ignores case, m makes ^ and $ work on each line, s lets . match line breaks, u turns on full Unicode, and y matches only where the last match ended.

Can it explain what an expression does?

Yes. Open Explanation to see each part of the expression in plain words, like "a digit, exactly 4 times".

Can I test a replacement?

Yes. Open Replace and type the replacement: use $1 for a group, $<name> for a named group and $& for the whole match.

Which regex flavour is this?

JavaScript, as in browsers and Node.js. Code shows the expression ready to use in JavaScript, Python, PHP, Java, C# and Go, and warns when a language lacks a feature.

Why was my expression stopped?

Some expressions take forever on certain text (catastrophic backtracking). The tester stops them after a moment, so the page never freezes; try a more specific pattern.

More free tools