Regex Tester
Test JavaScript regular expressions with live match highlighting, groups and replace preview.
Match details
How to use the Regex Tester
- Enter a pattern (without slashes) and choose flags.
- Type or paste test text.
- Matches are highlighted and listed with their capture groups.
- Optionally enter a replacement to preview the result.
Examples
[\w.+-]+@[\w-]+\.[\w.]+ with flag g
(\d{4})-(\d{2})-(\d{2}) → replace with $3/$2/$1
Features
- Live highlighting
- Capture and named groups
- Flags g, i, m, s, u, y
- Replace preview with $1 / $<name>
- Common pattern library
About this tool
Regular expressions describe text patterns for searching, validating and transforming strings. Testing against realistic sample text before using a pattern in code helps catch edge cases.
Frequently asked questions
Which regex flavour is this?
JavaScript (ECMAScript). Most syntax is shared with PCRE, Python and Java, but lookbehind and some features differ between engines.
Why does my page freeze on some patterns?
Some patterns cause catastrophic backtracking. The tester caps matches and stops very long runs, but simplify nested quantifiers like (a+)+.
Is my text sent anywhere?
No. Matching runs in your browser.
Privacy
Processed locally in your browser. Your data never leaves your device. The tool's code runs in your browser tab; nothing you enter or select is uploaded, and nothing is saved after you close the page.