Skip to content
LocalToolLab

100% Client-Side • Zero Server Uploads

Regex Tester

Test JavaScript regular expressions with safe highlighting, capture groups, and replacement previews.

Test JavaScript regular expressions safely in your browser. The Regex Tester runs patterns in a Web Worker with a hard timeout, so a poorly constructed expression cannot freeze your page. See matches, capture groups, and replacement previews instantly — no data is sent to a server.

Interactive Regex Tester workspace

50 / 1,000 characters used

Pattern is limited to 1,000 characters.

Flags

Allowed flags: g, i, m, s, u, y, d.

65 / 20,000 characters used

Match summary

0 matches found.

Highlighted input

Contact us at support@localtoollab.com or sales@localtoollab.com.

Replacement result

Replacements appear here after a match is found.

How to use the Regex Tester

  1. 1

    Enter a pattern

    Type a JavaScript regular expression pattern. The pattern is capped at 1,000 characters.

  2. 2

    Set flags

    Toggle global, case-insensitive, multiline, dotAll, unicode, sticky, and has-indices flags as needed.

  3. 3

    Add test input

    Paste the text you want to test against. Input is capped at 20,000 characters.

  4. 4

    Review matches

    See all matches, their positions, capture groups, and a replacement preview.

  5. 5

    Copy the match list

    Copy matches with indices and capture groups for test cases or bug reports.

Why use this tool

ReDoS protection

Patterns run in a Web Worker with a 300 ms timeout. A catastrophic expression is terminated before it can freeze the page.

Safe highlighting

Matches are highlighted using React nodes, never innerHTML, so there is no injection risk.

Local execution

All regex processing happens in your browser. No input is transmitted or stored.

Runaway patterns are stopped

A 300 ms main-thread timeout terminates the worker so a pathological pattern cannot freeze the tab.

Common use cases

Validate input formats

Test whether a pattern matches email addresses, URLs, phone numbers, or other structured input.

Debug capture groups

Inspect which parts of your input match each capture group in your pattern.

Preview replacements

See how a replace operation will transform your text before applying it in code.

Frequently asked questions

What is ReDoS and how does this tool prevent it?
ReDoS (Regular Expression Denial of Service) happens when a poorly constructed pattern takes excessive time to evaluate. This tool runs regex in a Web Worker with a 300 ms timeout, so runaway patterns are terminated.
What flags are supported?
The supported flags are g, i, m, s, u, y, and d. Any other flag is rejected.
Is there an input limit?
Yes. Patterns are capped at 1,000 characters and test input at 20,000 characters to protect browser performance.
Are my regex patterns sent anywhere?
No. All regex processing happens locally in your browser via a Web Worker. Nothing is sent to a server.

Keep working in your browser with another tool from the same category.

Developer

JWT Decoder

Inspect JWT headers and payloads locally without verifying signatures or sending tokens anywhere.

Open tool