Regex Tester
Test JavaScript regular expressions with flags (g, i, m, s), match highlights, and capture groups.
Privacy Notice: Runs locally in your browser without uploading files to external servers or requiring an account.
Interactive Browser Workspace
Loading the interactive Regex Tester workspace. Enable JavaScript in your browser to run calculations and conversions locally.
How to Use Regex Tester
- Enter your regex pattern (without outer slashes) and select flags (`g`, `i`, `m`, `s`).
- Type or paste sample text to inspect highlighted matches and capture groups.
Methodology & Accuracy
Executes native ECMAScript `RegExp` in a loop capped safely at 1,000 matches to protect browser responsiveness.
Examples
- Pattern `(\d{4})-(\d{2})-(\d{2})` matches ISO dates and captures year, month, and day.
Scope & Limitations
- Uses JavaScript RegExp flavor; PCRE-specific syntax like possessive quantifiers is not supported in JS.
Frequently Asked Questions
Why is match output capped at 1,000 matches?
Capping prevents accidental infinite loops on zero-width patterns against large inputs.
Which regular expression engine and flags are supported?
Patterns run on the native JavaScript RegExp engine with support for standard flags including `g`, `i`, `m`, `s`, and `u` as well as named capture groups.
How can I inspect numbered or named capture groups for each match?
The match breakdown lists full matches alongside their indexed and named capture groups so you can verify extraction patterns before deploying code.
Related Tools
- Find and Replace Text - Search and replace text with exact match, case sensitivity, whole-word, and Regex support.
- JSON Validator - Check JSON syntax strictly against RFC 8259 and pinpoint syntax errors immediately.