Online Regex Tester & Debugger – Live Match Highlights

Test and debug JavaScript regular expressions with live highlighting.

/
/
Test String
Match Results 0 Matches

Enter a pattern and test string to see results.

What is a Regular Expression?

A Regular Expression (often abbreviated as "Regex" or "RegExp") is a powerful tool used in software engineering to match and manipulate text strings based on specific patterns. Instead of searching for an exact word, regex allows you to search for abstract concepts—like "find all strings that look like an email address" or "find a sequence of 3 digits followed by a hyphen."

Debugging Regex

Regex syntax is infamously dense and difficult to read. Writing a complex pattern often requires trial and error. A regex tester is an essential debugging tool because it allows you to instantly see how your pattern behaves against a test string. Our tool runs the standard JavaScript regex engine, highlighting exactly what text was matched and what data was caught in your capture groups.

Understanding Capture Groups

Capture groups are created by wrapping a section of your regex in parentheses: (...). When the engine finds a match, it not only returns the entire matched string, but it also extracts the specific substrings matched inside the parentheses. This is incredibly useful for parsing. For example, if you match an email with (.+)@(.+), Group 1 will contain the username, and Group 2 will contain the domain name.

Frequently Asked Questions

A Regular Expression (regex) is a sequence of characters that forms a search pattern. It is used in programming for string matching, searching, and replacing text. For example, the regex ^[a-z]+$ matches any string containing only lowercase letters.
This tool runs directly in your browser, so it uses the JavaScript (ECMAScript) regular expression engine. It supports modern features like named capture groups and lookbehinds depending on your browser version.
The Global (g) flag tells the engine to find all matches rather than stopping at the first one. Case Insensitive (i) makes it ignore capitalization. Multiline (m) changes the behavior of ^ and $ to match the start and end of individual lines within a string, rather than the whole string.
When you wrap part of your regex in parentheses like (abc), it creates a capture group. The engine will not only find the full match but also extract the exact text matched by the group, which is highly useful for parsing data.

Related Free Tools