⚙️ Live · Highlights · Capture Groups

Regex
Tester

Test and debug regular expressions live with instant match highlighting. Supports all JavaScript regex flags and shows capture groups.

Regular expression
/ /
g — global i — case insensitive m — multiline s — dotAll u — unicode
Quick reference — click to insert:
\d+One or more digits
\w+Word characters
\s+Whitespace
[A-Za-z]+Letters only
^.+$Entire line
\b\w+\bWhole word
emailEmail address
URLHTTP/HTTPS URL
IPv4IP address
#hexHEX color
dateYYYY-MM-DD date
phonePhone number

Free Online Regex Tester — Test Regular Expressions Live

ExperToolBox's regex tester lets you write, test and debug regular expressions with instant visual feedback. Type your pattern, paste your test string, and all matches are highlighted in real time as you type. No page refresh needed — results update instantly with every keystroke.

The tool supports all standard JavaScript regular expression flags: g (global), i (case insensitive), m (multiline), s (dotAll) and u (unicode). Toggle flags with the buttons or type them directly into the flags field. Capture groups from the first match are shown separately so you can verify your groups are working correctly.

What are regular expressions?

Regular expressions (regex or regexp) are patterns used to match character combinations in strings. They're a fundamental tool in programming, used for validating input (email addresses, phone numbers, postal codes), searching and replacing text, extracting specific parts of strings (like dates or URLs from a document), and processing log files and data.

Regular expressions are supported in virtually every programming language — JavaScript, Python, Java, PHP, Ruby, Go, and more. While the syntax is largely similar across languages, there are differences in advanced features. This tester uses JavaScript's regex engine.

Common regex patterns

Some of the most commonly used regex patterns include: email validation ([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}), URL matching (https?:\/\/[^\s]+), date format (YYYY-MM-DD: \d{4}-\d{2}-\d{2}), and phone numbers (\+?[\d\s\-()+]{7,}). The quick reference panel in the tool above includes these and more — click any to insert it into the pattern field.

Frequently Asked Questions

What regex flavour does this use?
This tester uses JavaScript's built-in RegExp engine. JavaScript regex is ECMAScript-compliant and supports most standard regex features, but lacks some features found in other flavours like lookbehinds in older browsers, or POSIX classes.
What does the g flag do?
The g (global) flag makes the regex find all matches in the string, not just the first one. Without g, only the first match is returned. Most use cases need the g flag enabled.
How do I use capture groups?
Wrap part of your pattern in parentheses to create a capture group: (\d{4})-(\d{2})-(\d{2}) creates three groups that capture year, month and day separately. The tool shows the captured values from the first match in the "Capture groups" section.
Why does my regex work in Python but not here?
Different regex flavours have different syntax. Python uses re module syntax which supports some features not available in JavaScript, like named groups (?P<name>) — in JavaScript they use (?<name>). Lookbehind assertions also have differences between flavours.

Other Free Developer Tools