Regex Tester & Debugger

Test and debug regular expressions with live match highlighting, capture groups, and flags. Includes common regex reference patterns. Free and client-side.

/ /
Test String
Matches (highlighted)
Matches will be highlighted here...
Match List
No matches yet.
Common Regex Reference
\\d+
Match digits (numbers)
\\w+
Match word characters
[a-zA-Z]+
Match letters only
[^@]+@[^@]+\\.[a-z]+
Simple email pattern
https?://\\S+
Match URLs
\\d{4}-\\d{2}-\\d{2}
Date (YYYY-MM-DD)
\\b\\d{3}-\\d{4}\b
Phone (123-4567)
\\$\\d+(\\.\\d{2})?
Currency amount

How to Use the Regex Tester

  1. Enter your regex pattern: Type your regular expression into the pattern field. Use standard regex syntax including character classes, quantifiers, groups, and anchors.
  2. Set your flags: Toggle flags like g (global match), i (case insensitive), m (multiline), s (dotall), and u (unicode) to control matching behavior.
  3. Paste your test text: Enter the text you want to test against. The tester highlights all matches in real time and shows captured groups for each match.
  4. Review matches and groups: The results panel shows every match with its position, captured groups, and a count of total matches found.

Understanding Regular Expressions

Regular expressions (regex) are a powerful pattern-matching language used to search, validate, and manipulate text. Originating in theoretical computer science in the 1950s, regex has become an essential tool in virtually every programming language, text editor, and command-line utility. A regex pattern describes a set of strings using a compact syntax that includes literal characters, metacharacters (like . for any character, * for zero or more), character classes ([a-z]), anchors (^ and $), and capturing groups ((...)).

Common regex use cases include email and phone number validation, URL pattern matching, log file parsing, search-and-replace operations, and password strength checking. Flags modify how the pattern is applied: g finds all matches rather than stopping at the first, i makes matching case-insensitive, m allows ^ and $ to match line boundaries, s allows . to match newlines, and u enables full Unicode support for international text.

Mastering regex takes practice, but the payoff is enormous. A single well-crafted pattern can replace dozens of lines of procedural string manipulation code. The key to effective regex is starting simple, testing incrementally, and understanding the specific behavior of each metacharacter. This tester makes that iterative process fast by showing results in real time as you refine your pattern.

Frequently Asked Questions

What regex engine does this use?
This tool uses the JavaScript RegExp engine built into your browser, which follows the ECMA-262 specification.
What do the flags mean?
g = global (find all matches), i = case-insensitive, m = multiline (^ and $ match line boundaries), s = dotAll (. matches newlines), u = unicode mode.
How many matches can it find?
The tool caps at 10,000 matches to prevent browser freezing on pathological patterns. Most real-world use cases stay well within this.
Can I use capture groups?
Yes. Capture groups are displayed for each match with their index and captured value.
What regex flavor does this tester use?
This tool uses JavaScript built-in regular expression engine, which follows the ECMAScript specification. It supports most common regex features. For features specific to PCRE (PHP), Python re, or Java regex, test in the corresponding environment for exact behavior.
How do I match special regex characters literally?
Precede any regex metacharacter with a backslash to match it literally. For example, to match a literal period, use \. instead of .. Common characters requiring escaping include . * + ? ^ $ { } [ ] ( ) | \.
Can I use capturing groups and backreferences?
Yes. Parentheses create capturing groups, and the results panel shows the contents of each group for every match. Backreferences like \1 can be used within the pattern to match previously captured text, which is useful for finding repeated words or balanced delimiters.

Related Tools