Developer Tools Browser-Based • No Sign-Up Interactive

Regular Expression Tester

Test regular expression patterns against sample text with flag support.

Regular Expression Tester Workspace

/ / g
Flags:

Match Highlight View

Matches will be highlighted here in real time...

Matches Breakdown

0 matches
Match # Matched Text Index Capture Groups
No matches found.

How to Use Regular Expression Tester

1

Enter a JavaScript regex pattern between the / delimiters (without adding outer slashes).

2

Toggle ECMAScript flags: g (global), i (case-insensitive), m (multiline), s (dotAll), or u (unicode).

3

Type or paste your sample text into Test String to evaluate matches automatically.

4

Inspect highlighted matches above and review exact index offsets and Capture Groups in the breakdown table below.

About Regular Expression Tester

Test and debug JavaScript regular expressions in real time. Highlights matches, capture groups, and supports global (g), case-insensitive (i), and multiline (m) flags.

Regular Expression Tester lets developers write, debug, and verify JavaScript regex patterns against sample strings with immediate visual match highlighting and capture-group inspection.

Because poorly structured quantifiers (catastrophic backtracking) can freeze normal single-threaded web pages, matching runs inside a sandboxed Web Worker that automatically aborts after 1,000 ms.

Key Capabilities

  • Executes regex matching inside an isolated Blob Web Worker with a strict 1,000 ms watchdog timeout against catastrophic backtracking (ReDoS).
  • Supports ECMAScript flags g, i, m, s, and u with live flag badge updates.
  • Highlights all matched substrings inline and lists each match index plus numbered capture groups in a structured table.
  • Handles zero-length matches safely without infinite worker loops.

Technical Specifications

Supported Format:
JavaScript RegExp (ECMAScript flags g, i, m, s, u)
Processing Engine:
Isolated Web Worker (1000 ms Timeout Guard)
Execution Model:
Browser-Local Execution
Compatibility:
Modern Chrome, Edge, Firefox, Safari

Privacy & Processing Architecture

Pattern compilation and test strings stay inside a local browser Blob Web Worker (worker-src blob:). Nothing you test is sent to external servers.

Practical Use Cases

Validating Input Formats & Form Rules

Verify email, slug, or custom code patterns against edge-case valid and invalid strings before shipping JS code.

Testing Capture Groups for Data Extraction

Check exact Group 1, Group 2, and index offsets in the Matches Breakdown table when writing log parsers.

Auditing Patterns for ReDoS Hang Risk

Test suspicious nested quantifiers safely under the 1,000 ms Web Worker watchdog without crashing your browser tab.

Supported Formats & Practical Limitations

  • Uses the browser's native ECMAScript (JavaScript) RegExp dialect; PCRE-only syntax ((?P<name>...) Python style, possessive quantifiers ++, or lookbehinds on very old browsers) follows JS engine support.
  • Results cap at 500 matches per test run (500+ matches) and terminate automatically if execution exceeds 1,000 ms.

Frequently Asked Questions

Regex evaluation runs on a separate background Web Worker thread. If a pattern triggers catastrophic backtracking and fails to finish within 1,000 ms, the parent tab terminates the worker immediately and displays a clear warning.

No. The / delimiters and flags are already provided around the input box—enter only the pattern itself.

Rendering thousands of DOM <mark> elements would slow the browser; matching caps safely at 500 matches per run.
Discover More

Related Tools

More in Developer Tools →
Popular

JSON Formatter & Validator

Format, validate, beautify, and minify JSON data with syntax checks.

Developer Tools Open
Visual

Text Compare & Diff Tool

Compare two text blocks and highlight line-by-line differences.

Text Tools Open
Utility

URL Encoder & Decoder

Safely encode and decode URL strings and query parameters.

Text Tools Open
Essential

Base64 Text Encoder & Decoder

Encode and decode plain text to and from Base64 string format.

Developer Tools Open