Regex Tester & Text Extractor

A tool for specifying a regular expression pattern and flags (g, i, m, s, u) and highlighting and listing matches against your text in real time. It also includes presets for common patterns like email addresses and URLs.

//g
Enter target text to highlight matches

No matches found

How to use

  1. Enter a regular expression in the pattern field, or choose one from "Common patterns" on the right.
  2. Click the g, i, m, s, and u flags to toggle them on/off. Enabling g searches for all matches.
  3. Type the text you want to search in the target text field, and matches are highlighted on the right in real time.
  4. Check the match position, matched string, and capture groups in the "Matches" list below, and use "Copy to clipboard" to copy the extracted results, one per line.

About this tool

This tool lets you try out JavaScript regular expressions right in your browser and immediately see the results of extracting patterns from text. It's useful for verifying regex used for extracting data from log files, validating form input, cleaning data, and more.

It supports toggling the main flags — g, i, m, s, and u. With the g flag off, only the first match is detected, matching actual JavaScript behavior. Matched strings are highlighted directly in the original text so you can visually confirm you're extracting the right parts.

Presets for commonly used patterns — email addresses, URLs, phone numbers, and more — are included, so you can try out a pattern right away without writing one from scratch.

Frequently asked questions

Does it support named capture groups?

Yes. When you use a named group like "(?<name>pattern)", it's shown in the match list as "name: value".

What happens if I turn off the g flag?

It behaves the same as actual JavaScript regular expressions, detecting only the first match. Enable the g flag if you want to see all matches.

What happens if I enter an invalid regular expression?

An error message appears below the pattern field, and no matching is performed. Check that parentheses are balanced and escaping is correct.

Is my input text sent to a server?

No. Regular expression evaluation and matching all run in your browser's JavaScript engine.