Regular Expression Tester
Test regular expression patterns against sample text with flag support.
Regular Expression Tester Workspace
Match Highlight View
Matches Breakdown
0 matches| Match # | Matched Text | Index | Capture Groups |
|---|---|---|---|
| No matches found. | |||
How to Use Regular Expression Tester
Enter a JavaScript regex pattern between the / delimiters (without adding outer slashes).
Toggle ECMAScript flags: g (global), i (case-insensitive), m (multiline), s (dotAll), or u (unicode).
Type or paste your sample text into Test String to evaluate matches automatically.
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
Related Tools
JSON Formatter & Validator
Format, validate, beautify, and minify JSON data with syntax checks.
Text Compare & Diff Tool
Compare two text blocks and highlight line-by-line differences.
URL Encoder & Decoder
Safely encode and decode URL strings and query parameters.
Base64 Text Encoder & Decoder
Encode and decode plain text to and from Base64 string format.