DevToolsForYou
Private by defaultRuns in your browser

Regex tester

Enter a pattern and test string to instantly see all matches highlighted, with capture groups listed below.

//g
Matches highlighted
Matches will be highlighted here…
Quick samplesCommon patterns
Regex Tester

About this tool

Test regular expressions live with match highlighting, capture groups, and all JavaScript flags. Paste your pattern and test string — instant results.

Enter a pattern and test string to instantly see all matches highlighted, with capture groups listed below.

No signup requiredRuns in your browserInstant results
How to use
  1. 1

    Enter your regular expression pattern in the pattern field (without slashes).

  2. 2

    Set any flags you need: g for global, i for case-insensitive, m for multiline.

  3. 3

    Paste your test string below — all matches are highlighted in real time.

  4. 4

    Hover a match to see the captured groups.

Why use this tool?
  • Test and debug regular expressions before adding them to your codebase.

  • Verify that a pattern matches the exact strings you expect without edge cases.

  • Inspect capture groups to confirm your regex extracts the right substrings.

ExamplesInput → output

Match all numbers

InputPattern: \d+ | Text: Order 123 and item 456
OutputMatches: 123, 456

Match email address

InputPattern: [\w.+]+@[\w.]+\.[a-z]{2,} | Text: contact@example.com
OutputMatch: contact@example.com

Match words starting with capital

InputPattern: \b[A-Z]\w* | Text: Alice and Bob went to London
OutputMatches: Alice, Bob, London
Frequently asked questionsCommon questions answered

These answers explain common regex tester tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.

Which regex flavour does this tool use?

This tool uses JavaScript's built-in RegExp engine, which follows the ECMAScript standard. It supports all standard flags: g (global), i (case-insensitive), m (multiline), and s (dotAll).

What are capture groups?

Capture groups are parts of a regex wrapped in parentheses. They let you extract specific substrings from a match. This tool lists each group's value for every match found.

Why does my pattern match nothing?

Common causes include forgetting to escape special characters like . or *, using anchors (^ or $) without the multiline flag, or a pattern that is more specific than the test string.

What regex flags does this tool support?

The tester supports the standard JavaScript regex flags: g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line starts and ends), and s (dotAll — dot matches newline characters). You can combine flags as needed.

How do I test a regex for email or URL validation?

Paste your regex pattern in the pattern field, then paste sample email addresses or URLs in the test string field. The tool highlights every match so you can immediately see which inputs pass and which do not, without running code.