Regex Tester – Test Regular Expressions Online Free
Regex Tester is a free online tool for testing and debugging JavaScript regular expressions in real time. Enter a pattern and test string to see live colour-highlighted matches, capture group values, and match indices — all updated within 200ms of each keystroke. Includes a replace mode and six common preset patterns.
Frequently Asked Questions
Which regex flavour does this tool use?
The tool uses JavaScript's native RegExp engine, which is ECMAScript-standard. This means it supports most common syntax: character classes (\d \w \s), quantifiers (+ * ? {n,m}), anchors (^ $), groups ((...)), non-capturing groups ((?:...)), lookaheads ((?=...) (?!...)), and the flags g (global), i (case-insensitive), m (multiline), and s (dotAll).
What do the flag toggles do?
The g (global) flag finds all matches instead of stopping at the first. The i flag makes the match case-insensitive. The m flag makes ^ and $ match at the start and end of each line rather than the whole string. The s (dotAll) flag makes the dot (.) match newline characters, which it normally ignores.
How does the Replace feature work?
Enter a replacement string in the Replace field and click "Replace All". JavaScript's String.replace() is used with the full regex. You can use $1, $2, etc. to insert capture group values into the replacement, or $& to insert the whole match.
What are the preset patterns?
Six common patterns are provided: Email, URL, Phone, IPv4 address, Date (YYYY-MM-DD), and Hex Color. Click any preset to load it into the pattern field. These are starting points — you can edit them to suit your needs.
Does the tool support lookbehind assertions?
Lookbehind assertions ((?<=...) and (?<!...)) are supported in modern browsers (Chrome 62+, Firefox 78+, Safari 16.4+). If your browser is older, they will produce a syntax error. The tool displays the browser's native error message, which makes it easy to diagnose unsupported syntax.