ProUtils

Regex Tester

Test regular expressions with live matching and capture group display.

About This Tool

Regex Tester is a free online tool for writing, testing, and debugging JavaScript regular expressions with live match highlighting and capture group display. Enter your pattern and test string, and matches are highlighted in real time as you type. Toggle flags (g, i, m, s) and see all capture groups labeled per match — without running any code.

The tool uses the browser's native JavaScript RegExp engine, so patterns behave exactly as they would in a Node.js or browser JavaScript application. Named capture groups, Unicode property escapes, lookaheads, lookbehinds, and all modern ECMAScript regex features are supported. Syntax errors in the pattern are caught and displayed immediately.

Regex Tester is used daily by developers validating input patterns (email, phone, URL), writing data extraction regexes for logs or CSVs, debugging complex patterns with multiple capture groups, and learning regular expressions through live experimentation.

//g
Contact us at hello@example.com or support@test.org

Matches: 2

#1hello@example.com@14
Group 1: helloGroup 2: example.com
#2support@test.org@35
Group 1: supportGroup 2: test.org

How to Use

  1. 1

    Enter your regular expression pattern in the Pattern field.

  2. 2

    Type or paste your test string in the Test String field.

  3. 3

    View highlighted matches and capture groups in real time. Toggle flags like g, i, m, s as needed.

  4. 4

    Add named capture groups (?<name>...) in your pattern to see them labeled in the match output.

  5. 5

    Use the match count and group data to confirm your pattern handles edge cases before using it in code.

Features

Live Match Highlighting

Matches are highlighted in the test string in real time as you type your pattern.

Capture Group Display

See all named and numbered capture groups listed for each match.

Flag Controls

Toggle global (g), case-insensitive (i), multiline (m), and dotAll (s) flags with checkboxes.

Match Count

The total number of matches is shown so you can quickly verify your pattern is working correctly.

Common use cases

  • Test email, phone number, or URL validation regex patterns before using them in production code.
  • Debug log-parsing regex patterns with real log line samples to extract structured fields.
  • Experiment with named capture groups to understand how to extract specific substrings.
  • Verify that a search-and-replace regex covers all edge cases in a string transformation pipeline.

FAQ

What regex flags are supported?

Global (g), case-insensitive (i), multiline (m), and dotAll (s) flags.

Does it show capture groups?

Yes, named and numbered capture groups are displayed for each match.

What regex flavor is used?

JavaScript RegExp (ECMAScript 2022+). This includes support for named capture groups (?<name>...), Unicode property escapes (\p{}), and dotAll mode.

How do I test a regex across multiple lines?

Enable the multiline flag (m) to make ^ and $ match the start and end of each line rather than the whole string. Use the dotAll flag (s) to make the dot (.) match newline characters.

What is the difference between the global flag and non-global?

Without the global flag (g), the regex only finds the first match. With (g), it finds all non-overlapping matches in the string. The match count in the tool reflects the total matches found.

Related Tools

Developer Tools