AI Tools Free

Regex Tester

Test JavaScript regular expressions in a separate worker and inspect matches, offsets, and capture groups.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Test regex.

Your result
Enter your details

Result will appear here

How Regex Tester works

The tester creates a JavaScript regular expression from your pattern and flags and searches the supplied text in a bounded worker.

The grid shows UTF-16 offsets, matched text, and capture groups. Results are capped at 1,000 matches, and expensive processing is stopped rather than allowed to run indefinitely.

Use distinct supported flags and a pattern no longer than 1000 characters.

A regular expression connected to highlighted matching segments in a text sample.
Illustration of the Regex Tester workflow.

Regex Tester Quick Reference & Input Guide

Review the input parameters, allowed value ranges, and worked reference cases for the Regex Tester below before running your calculation.

Parameter / ScenarioDefault / Sample ValueRule or Allowed RangeOutput / Usage Note
Input: Pattern (without / delimiters)\b[a-z]+\bInput type: textRequired workspace parameter
Input: FlagsgiInput type: textRequired workspace parameter
Input: Test text(User supplied)Input type: textareaRequired workspace parameter

How to use Regex Tester

Enter a JavaScript regular expression, its flags, and the text to test.

Prepare pattern and test text

Enter the pattern without slash delimiters, set the distinct JavaScript flags, and paste the test text. Include representative matches and nonmatches in a bounded sample before expanding it.

Pattern (without /…
Regex Tester native input panel with the actual Pattern (without / delimiters), Flags, Test text settings used for this example.
Configure Pattern (without / delimiters), Flags, Test text; select Test regex.

Run the JavaScript search

Start the test and read the match total. The output identifies the flags and whether the displayed results reached their cap. Without a global flag the search returns only its first match.

3 matches
Regex Tester actual result panel showing 3 matches.
Submitted result: 3 matches. Flags: g.

Inspect offsets and groups

Read the match grid, including offsets, matched text, and capture groups. Offsets are UTF-16 code units. A timeout or capped result calls for a smaller or more focused sample, not an assumption about unseen matches.

Output details
Regex Tester actual output details region and result note after submitting the pictured settings.
Review the actual Regex Tester output. Read the result note.

When to use Regex Tester

Compare baseline and alternative runs for Regex Tester before exporting the result.

Test a regex extraction pattern

Paste a few representative records when designing a pattern to extract a code or identifier. Include a record missing that identifier. This helps reveal accidental matches without requiring you to test the entire source file at the outset.

Developer input and configuration represented by document cards.
Prepare the input. Concept illustration.

Inspect capture groups before replacement

Test what a pattern matches before using it in a separate replacement operation. Captured groups can help explain which portions a replacement would reference, but this screen reports matches and does not apply a replacement to the input.

A developer example flowing from input to reviewed output.
Inspect an example. Concept illustration.

Compare JavaScript behavior

Use a compact example to investigate a difference between a browser pattern and another regex engine. Record the pattern and flags with the result. A JavaScript match does not establish that a PCRE or server language pattern behaves identically.

Developer output handed to the next stage of a workflow.
Use the result in your workflow. Concept illustration.

Read match positions and limits

Review the calculated output alongside your entered parameters and unit conventions.

Every calculation follows the rule: Uses the browser's JavaScript RegExp engine. Match indices are UTF-16 code-unit offsets. Because JavaScript uses IEEE 754 double-precision floating-point arithmetic, numeric outputs display up to 12 significant digits where applicable.

Always cross-check the displayed result against the scope note (Input is limited to 50,000 characters, patterns to 1,000, and output to 1,000 matches. A worker time limit stops expressions that take too long. Results are specific to JavaScript regex syntax) before applying the value to production specifications, financial models, or lab records.

A developer result reviewed alongside its source.
Review the returned output. Concept illustration.

Check syntax before expanding the sample

Test representative matching and nonmatching text with the flags supported by your browser.

Operational scope: Input is limited to 50,000 characters, patterns to 1,000, and output to 1,000 matches. A worker time limit stops expressions that take too long. Results are specific to JavaScript regex syntax. Inputs that violate minimum/maximum bounds or required format rules are rejected with a clear diagnostic prompt.

Need an adjacent calculation in Developer Tools? Use the related tools linked below to chain your workflow without leaving your browser.

Input format and assumptions reviewed for a developer task.
Check format and assumptions. Concept illustration.

Frequently Asked Questions About Regex Tester

Answers about using Regex Tester and understanding its results.

Can I paste /pattern/g?

Enter the pattern without the outer slashes and put g in Flags.

What if the pattern matches an empty string?

The tester advances safely after each zero-length match so it does not loop forever.

Does it use the same syntax as Python or PCRE?

No. It uses the browser JavaScript RegExp engine. Check features and flags against the environment where your pattern will run.

Why do I see only one match?

Without the g flag the tester reports the first match. Add g when you want a global search.

Test a JavaScript regular expression

Choose another tool for your next calculation, conversion, or text task.

Test a pattern