tools.now

Regex Tester

Write a pattern, paste some text and see each match with its index and capture groups. It uses the JavaScript (ECMAScript) regex engine built into your browser.

Output

🔒 Runs in your browser. Your data is never uploaded.

How to use

  1. Enter the pattern without the surrounding slashes.
  2. Set flags: i ignore case, m multiline, s dot matches newline, u unicode.
  3. Read the matches and groups; they update as you type.

Engine differences

This is JavaScript syntax. Named groups are (?<name>…), lookbehind is supported, but possessive quantifiers and inline flags like (?i) from PCRE or Python are not.

Frequently asked questions

Do I need the g flag?
The tester always lists all matches, so g is implied. In your own code, g decides whether match() and replace() handle the first match or every match.
Why does my pattern from Python or PHP fail?
Some syntax differs between engines: (?P<name>…) is written (?<name>…) in JavaScript, and inline modifiers such as (?i) are not supported.
Why is the page slow with my pattern?
Nested quantifiers such as (a+)+ can cause catastrophic backtracking on certain inputs. Make the pattern more specific or avoid nesting repeated groups.

Related tools