Command Palette

Search for a command to run...

REGEX

Regex Tester

Test and debug regular expressions with live highlighting.

Regex Tester
Test and debug regular expressions with live highlighting.

Flags like g (global), i (case-insensitive), m (multiline) are supported. Global is added automatically for highlighting.

Highlighted result
Matches are highlighted in real time. Zero-length matches are shown as empty markers.
Contact us at hello@example.com or support@test.dev. We also read feedback at hi@run.tools
3 matches
hello@example.com
Index 14, length 17
support@test.dev
Index 35, length 16
hi@run.tools
Index 78, length 12
Recent patterns
Your last patterns are saved locally for quick reuse.

Your recent regex patterns will appear here.

What

Regex Tester definition

A regex tester lets you test patterns, matches, and capture groups against sample text.

Cases

Use Cases

1

Validate a new regular expression

2

Extract groups for parsing tasks

3

Debug why a pattern fails

How To

How to Test a Regular Expression

A step-by-step guide to validating patterns and inspecting matches.

1

Enter pattern

Type your regex pattern (e.g., \\b\\w+@example\\.com\\b).

2

Set flags

Pick flags like g/i/m as needed.

3

Inspect matches

Review highlighted matches and captured groups in the test string.

Knowledge

Understanding Regular Expressions

What is Regex?
Regular expressions (regex) are patterns used to match character combinations in strings. They're powerful for searching, validating, and transforming text across virtually all programming languages.
Basic Syntax
. matches any character. * matches zero or more. + matches one or more. ? makes optional. ^ anchors to start, $ to end. [] defines character classes. () creates groups. \ escapes special characters.
Character Classes
\d matches digits, \w matches word characters (letters, digits, underscore), \s matches whitespace. Uppercase versions (\D, \W, \S) match the opposite. Custom classes like [a-zA-Z] match specified ranges.
Regex Flags
g (global) finds all matches. i (case-insensitive) ignores case. m (multiline) changes ^ and $ behavior. s (dotall) makes . match newlines. u (unicode) enables full Unicode support.
Capture Groups
Parentheses create capture groups that extract matched portions. Named groups (?<name>...) improve readability. Non-capturing groups (?:...) group without capturing. Backreferences (\1, \2) reference previous groups.

FAQ

Regex FAQ

What is a regular expression?
Regular expressions (regex) are patterns used to match text based on rules.
When were regular expressions created?
The concept was introduced by mathematician Stephen Kleene in the 1950s to describe formal languages.
Where are regex patterns commonly used?
They are widely used in programming languages, search tools, text editors, command-line filters, and databases.
What problems are regex best at solving?
Regex shines when validating input formats, extracting structured data from text, and performing advanced find-and-replace tasks.
How should I choose flags for my regex?
Use g for global matches, i for case-insensitive, m for multi-line line-start/end anchors, and u for proper Unicode handling when needed.
How does this Regex Tester help?
It highlights matches in real time, shows captured groups, remembers recent patterns, and lets you copy results for debugging or sharing.
Regex Tester