Regex Tester

Test JavaScript regular expressions against sample text with live match results.

Input Text
Match Output

How to Use

  1. 1 Enter your regular expression pattern in the Pattern field.
  2. 2 Add flags in the Flags field (e.g. g for global, i for case-insensitive, m for multiline).
  3. 3 Paste your test text into the Input Text panel.
  4. 4 Click Test Regex to run the pattern and see all matches in the output.
  5. 5 Use Sample Input to load an example pattern and text.
  6. 6 Click Copy to copy the match output, or Clear to reset.

Frequently Asked Questions

Which regex engine does this tool use?

This tool uses the JavaScript RegExp engine built into your browser. It supports the ECMAScript regex syntax including lookaheads, lookbehinds, named groups, and Unicode property escapes.

What flags are supported?

All standard JavaScript regex flags are supported: g (global), i (case-insensitive), m (multiline), s (dotAll — dot matches newlines), u (Unicode), y (sticky), and d (indices, in modern browsers).

Is my text sent to a server?

No. All regex matching runs entirely in your browser. Your pattern and test text never leave your device.

How do I test for multiple matches?

Use the g (global) flag to find all matches in the text. Without the g flag, only the first match is returned.

Can I use named capture groups?

Yes. JavaScript supports named capture groups with the syntax (?<name>pattern). The output will show the named group values alongside the full match.

Why does my regex work in one language but not here?

Different programming languages have different regex engines with different syntax and features. This tool uses the JavaScript engine. Features like PCRE lookbehinds or possessive quantifiers may not be available.

How do I escape special characters in my pattern?

Special regex characters (. * + ? ^ $ { } [ ] | ( ) \) must be escaped with a backslash. For example, to match a literal dot, use \. in your pattern.

What does the output show?

The output shows all matches found, including the matched text, its position (index) in the input, and any capture group values. Each match is shown on a separate line.