Test regular expression patterns in real-time. Supports matching, group extraction, and replacement.
Type your regular expression pattern in the input field. Set flags (global, case-insensitive, etc.) as needed.
Enter the text you want to test against the pattern. Matches will be displayed in real-time.
Matched portions are highlighted. Enter a replacement string to preview the replacement result.
Regex Tester is an online tool that lets you test and debug regular expression patterns in real-time. You can instantly verify string matching, group extraction, and replacement operations in your browser. It significantly improves development efficiency when working with regular expressions in programming or text processing.
This tool uses the JavaScript (ECMAScript) regex engine. It supports standard regex syntax that works in most browsers, but some language-specific features (Perl or Python-specific syntax) may not be available.
g (global) searches for all matches, i (case-insensitive) ignores case, m (multiline) applies ^ and $ to each line, s (dotAll) makes . match newlines, u (Unicode) enables Unicode support, and y (sticky) matches from a specific position.
A warning is displayed when execution time is long. Avoid nested quantifiers (e.g., (a+)+) and patterns with excessive backtracking. Consider using atomic groups or possessive quantifiers, or simplify the pattern.
These are special notations used in replacement strings where $1 corresponds to the first capture group and $2 to the second. For example, if pattern "(\d+)-(\d+)" matches "123-456" and you replace with "$2:$1", the result is "456:123".
Groups defined using (?<name>pattern) format that can be accessed by name instead of number. They improve readability of complex patterns and can be referenced as $<name> in replacements.