
Regex Escape Tool
Escape regular-expression metacharacters for a JavaScript regex literal pattern.
Open toolTest JavaScript regular expressions in a separate worker and inspect matches, offsets, and capture groups.
Enter the inputs, then select Test regex.
Result will appear here
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.

Review the input parameters, allowed value ranges, and worked reference cases for the Regex Tester below before running your calculation.
| Parameter / Scenario | Default / Sample Value | Rule or Allowed Range | Output / Usage Note |
|---|---|---|---|
| Input: Pattern (without / delimiters) | \b[a-z]+\b | Input type: text | Required workspace parameter |
| Input: Flags | gi | Input type: text | Required workspace parameter |
| Input: Test text | (User supplied) | Input type: textarea | Required workspace parameter |
Enter a JavaScript regular expression, its flags, and the text to test.
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.
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.
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.
Compare baseline and alternative runs for Regex Tester before exporting the result.
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.

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.

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.

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.

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.

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

Pixels = REM value × root font size.
Open tool
Apply the reversible ROT13 substitution to ASCII letters.
Open tool
Parse JavaScript with Terser and print compact syntax with compression and name mangling disabled.
Open toolGenerate a PHP array expression from JSON without running code.
Open toolAnswers about using Regex Tester and understanding its results.
Enter the pattern without the outer slashes and put g in Flags.
The tester advances safely after each zero-length match so it does not loop forever.
No. It uses the browser JavaScript RegExp engine. Check features and flags against the environment where your pattern will run.
Without the g flag the tester reports the first match. Add g when you want a global search.
Choose another tool for your next calculation, conversion, or text task.