Skip to content

Regex Tester

Test regular expressions against text with live matches and capture groups.

Expression
Test Text
Matches

Regex Tester

Test JavaScript regular expressions against sample text and inspect match positions, captured groups, and common flags in real time.

The matcher runs in a worker with a timeout, so expensive expressions cannot freeze the page.

How to use Regex Tester

Use the regex tester to check a JavaScript regular expression against sample text. It helps you see matches before using the pattern in code.

Developers often use this page when they need regex tester, regex checker, regex validator, and javascript regex tester.

Privacy and data handling

This tool is designed to run in your browser for normal use, so your input does not need to be sent to a server.

  • Input and output stay on the page while you work.
  • Copy buttons use your browser clipboard permission when available.
  • Avoid pasting private production data on shared or untrusted devices.

Examples

Find email-like text

Input

Pattern: \b[\w.-]+@[\w.-]+\.\w+\b
Text: Contact ada@example.com today.

Output

Match: ada@example.com

This is useful for simple extraction. Production email validation may need different rules.

Capture a date

Input

Pattern: (\d{4})-(\d{2})-(\d{2})
Text: Release date: 2026-05-10

Output

Groups: 2026, 05, 10

Capture groups help you pull structured parts out of a larger string.

Steps

  1. 1Enter a regex pattern and optional flags.
  2. 2Paste sample text that looks like your real input.
  3. 3Review matches and capture groups, then adjust the pattern.

Common use cases

  • Test validation patterns for forms.
  • Extract values from logs or text files.
  • Debug a regex before adding it to JavaScript code.

Practical tips

  • Use real sample data, including bad examples.
  • Be careful with greedy patterns like .* because they may match too much.
  • Escape special characters when you want to match them literally.

FAQ

What regex flavor does this use?

It is meant for JavaScript regular expressions, so behavior follows the JavaScript RegExp engine.

Why does my regex match too much text?

A greedy quantifier may be taking more text than expected. Try a more specific character class or a lazy quantifier.

Related Developer Tools