Skip to content
Let’s talk
Menu
← All free toolsJBR / Developer

Regex Tester

Test JavaScript regular expressions with live matches, capture groups, indices, and a replacement preview. Your test text stays in your browser.

Runs locally in your browser · no uploads or account
01 / JAVASCRIPT REGEXPLOCAL ONLY
Advanced: match rules & replacement

Flags change the search rules. All matches finds every occurrence; Ignore case treats A and a alike. Replacement is the text to insert for each match.

Checking browser flag support…

02 / MATCHES & REPLACEMENTJAVASCRIPT ENGINE

No test yet.

Capture groups & positions

Groups are parenthesized parts of your pattern. Positions count from zero in the text.

Sharing includes the pattern itself and its flags in the copied link. Review the pattern for private information first. Test text and replacement text are never included. The address bar is not updated automatically.

Enter a pattern and test text. Changes run after a short pause.

PATTERNS MADE VISIBLE

Understand what
your expression matches.

Your browser’s JavaScript engine.

This tool uses JavaScript RegExp, not PCRE. Use g for all matches. Without it, only the first match is shown and replaced. Capture groups retain their numbered and named values. Enable d for group indices when supported. Positions are zero-based UTF-16 offsets; an unmatched optional capture is shown as null.

Replacement strings, without code.

Use $$ for a dollar, $& for the match, $1 for a capture, and $<name> for a named capture. Prefix and suffix substitutions follow native JavaScript rules. No JavaScript is evaluated.

Limits: 2,000 pattern characters, 100,000 test characters, 10,000 replacement characters, and 1,000 matches. Output is bounded to 200,000 characters. A terminable worker stops processing after two seconds and is replaced on every edit. Simplify costly patterns after a timeout. Workers are required; there is no main-thread fallback, saved history, or upload.