Regex Tester — Live Match Highlighting and Replace
Test JavaScript regular expressions live with highlighted matches, capture groups, flags and replacement preview.
Processed locally in your browser. Nothing is uploaded.
How to use
- Enter a pattern and flags.
- Paste test text.
- Inspect matches, groups and the replacement.
Example and rules
Example: (\d{4})-(\d{2}) matches 2026-10 with group 1 = 2026 and group 2 = 10.
- Uses the browser's JavaScript engine (ES2024 syntax).
- Shows up to 1,000 matches; test text up to 1 MiB.
- Includes common patterns such as email, URL and IP address.
Frequently asked questions
What do g, i and m mean?
Global, case-insensitive, and multiline where ^ and $ match each line.
How do I reference groups in a replacement?
Use $1, $2 or named groups as
lt;name>.Is it the same as Python or Java regex?
Mostly, though some advanced features differ.