About the Regex Tester
Test JavaScript regular expressions against your own text. Every match is listed with its position, line number, numbered capture groups and named groups, and you can preview a replacement using $1 or $<name> references.
Flags g, i, m, s, u, y and d are supported. Errors in the pattern are reported clearly, so you can fix them before putting the regex in your code.
How to use it
- Enter the pattern and flags.
- Paste the test text in the input.
- Optionally add a replacement string to preview the result.
Features
- JavaScript (ECMAScript) regex engine
- Capture and named groups
- Replacement preview
- Match index and line number
Frequently asked questions
Which regex flavour does it use?
Your browser's JavaScript engine. Syntax is very close to PCRE for common patterns, but lookbehind support, possessive quantifiers and some escapes differ from Python, Java or PHP.
How do I reference groups in the replacement?
Use $1, $2… for numbered groups, $<name> for named groups and $& for the whole match.
Is my data uploaded anywhere?
No. All processing happens in JavaScript inside your browser tab. Your input is never sent to a server, logged or stored, so it is safe to use with internal or sensitive data.