Regex Tester Online — JavaScript Match & Replace
Test JavaScript regular expressions against sample text. Toggle flags, inspect capture groups, and preview replacements — everything runs locally in your browser.
How testing works
Enter a pattern and subject, toggle flags (g/i/m/s/u/y), then Test. Match mode lists each hit with index and groups. Replace mode also shows the substituted string. Pathological patterns can freeze the tab — keep experiments local and avoid nested quantifiers on large subjects.
Options
Examples
Capture pairs
Pattern + subject
Result
Replace with $1
Pattern + subject
Result
Related utilities
Need URL-safe labels? Use slugify. Generate secrets with the password generator.
Regex tester FAQ
Pattern debugging questions
Is this PCRE or Python regex?
No — this tool uses the browser’s JavaScript RegExp engine only (same flavor as in Node and modern browsers).
Can a pattern freeze my browser?
Yes. Catastrophic backtracking (ReDoS-style patterns) can hang the tab because execution is local. Prefer simple patterns and smaller subjects when experimenting.
Are named groups supported?
Yes, when the engine returns them — they appear next to numbered groups in the match list.
Is my text uploaded?
Never — testing stays in your browser.
More developer utilities in this cluster
Looking for converters, encoders, formatters, and minifiers in one place? Developer tools hub Open the curated developer tools catalogue.