Test regular expressions
Updates
Recently shipped improvements
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}https?://[\w\-._~:/?#[\]@!$&'()*+,;=%]+0\d{1,2}-\d{3,4}-\d{4}\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\d{4}-\d{2}-\d{2}\d+[a-zA-Z]+<[^>]+>Regex Tester is an interactive online tool that allows you to write, test, and debug regular expressions in real time. Regular expressions (regex) are powerful pattern-matching sequences used in programming, text processing, and data validation. This tool provides instant visual feedback by highlighting matches, displaying capture groups, and supporting string replacement — making it an indispensable companion for developers, data analysts, and anyone working with text patterns.
Enter regular expression pattern
Enter the regular expression pattern you want to test in the top input box. For example, you can create a pattern for email validation or a pattern for extracting specific strings.
Set Flags
Enable the g (global search), i (ignore case), m (multiline), and s (dotAll) flags as needed. Matching behavior varies depending on the flag combination.
Enter test string
Enter the target string to check with a regular expression. As soon as you input, the matched part is highlighted so you can check the results in real time.
Check matching results
Check detailed information such as the number, location, and capture group of matched strings. If necessary, you can also preview the substitution results by entering the substitution string.
Use cheat sheets and templates
If you don't remember the regular expression syntax, you can refer to the built-in cheat sheet and quickly apply frequently used pattern templates by clicking on them.
Without the g(global) flag, it will just look for the first match and stop, but with the g flag enabled, it will find all matches throughout the string. When replacing, the g flag is also required so that all matches are replaced.
The part enclosed in parentheses () becomes the capture group. When making substitutions, $1 refers to the matching value of the first group and $2 refers to the matching value of the second group. For example, you can reverse the date format by substituting $2/$1 in the pattern (\d{4})-(\d{2}).
The m(multiline) flag causes ^ and $ to match the start/end of each line rather than the start/end of the entire string. This is useful when you need to apply a pattern line by line in multi-line text.
In regular expressions, characters with special meaning (. * + ? ^ $ [ ] { } ( ) | \) must be preceded by a backslash (\) to match them as literals. For example, to find a period, write \.
By default, the . (dot) matches any character except the newline character (\n). Enabling the s flag causes . to match any character, including a newline character, which is necessary when processing patterns that span multiple lines.