go-supertools
Developer & Data Tools

Regex Tester

Test your Regular Expressions

Runs in your browser Your input never leaves your device.

0 characters | 0 words
—

About this tool

Test a regular expression against a string and see every match with its position and any capture groups. It uses your browser's JavaScript regular expression engine, so the syntax and flags are those of JavaScript. Enter a pattern, adjust the flags (the g flag is always added so all matches are listed) and type your test string. Matching runs locally in your browser. At most 1000 matches are shown. Other regex flavors such as PCRE or Python can differ in details.

How to use it

  1. Enter your pattern without surrounding slashes.
  2. Set flags if needed, for example i for case-insensitive (g is always on).
  3. Type or paste the test string.
  4. Read the list of matches with their positions and groups.

Example

@ shows the zero-based position where each match starts.

Input
Pattern: \d+   Test string: a1 b22 c333
Result
3 matches:
@1: "1"
@4: "22"
@8: "333"

Common problems

Pattern shows an error
The pattern is not valid JavaScript regex, for example an unclosed bracket or a lookbehind your browser does not support. The message from the engine is shown.
"No matches" but you expected some
Check case (add the i flag), anchors (^ and $ match only at the whole string unless you add m) and escaping of characters such as . and ( .
Pattern works here but not in your code
Your language may use a different regex flavor or different flag names. Test in the same engine you will deploy to.