Regex Tester

Test a JavaScript regular expression against sample text and inspect its matches.

Inputs stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Test pattern controls

Showing an example. Edit to see your own.

JavaScript pattern, written without the surrounding slashes.

The pattern is tested against this text only, in this browser.

With global off, the result shows the first match only.

With ignore case on, Cat and cat both match.

Without it, ^ and $ mean the start and end of the whole text.

With this on, a dot also matches the line break between two lines.

Needed for \p{L} style classes and for emoji to count as one character.

Processed in your browser. Your inputs stay on this device.

How to use Regex Tester

  1. Enter a JavaScript pattern without the surrounding slashes.
  2. Paste the sample text and choose the flags you need.
  3. The matches update as you change the pattern or the sample. Read the match positions and capture groups.
  4. If the time limit stops a pattern, shorten the sample or revise the repetition.

Example: Regex Tester

Find email-like text in two lines.

You add
Pattern: (\w+)@(\w+)\.(\w+); text: [email protected] and [email protected]; Global on.
You get
Two matches with line and column positions and three capture groups per match.

Supported inputs and limits

Uses the browser's JavaScript regular-expression flavor, not PCRE or Python syntax. The pattern is capped at 200 characters, sample text at 100,000 characters and displayed matches at 2,000. A background worker is stopped after 1.5 seconds; timing depends on the visitor's device. Email-like matches are not email-address validation.

Where your input is processed

This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Questions about Regex Tester

Why did a pattern work in another regex tool but fail here?

Regex flavors differ. This page uses JavaScript syntax and the selected JavaScript flags; PCRE-specific features may not compile.

Why did the pattern stop before showing matches?

Some patterns take too long on particular text. The background worker is stopped after the time limit so the page stays usable.

What does Global change?

Global asks for successive matches. With it off, the page reports the first match only.

Are match positions byte offsets?

No. Positions follow JavaScript text indexing, which counts UTF-16 code units. A character outside the basic multilingual plane may use two units.

Project manager: Tony Hines · Content updated 29 September 2026 · Report a problem