RegEx Tester
Test and debug regular expressions in real-time.
Regular Expression
Test String
Matches (0)
What is a Regular Expression?
A Regular Expression (RegEx) is a sequence of characters that defines a search pattern. They are used in programming for string matching, validation, searching, and text transformation. C# developers use System.Text.RegularExpressions.Regex in .NET; JavaScript developers use built-in RegExp objects.
This tool provides an instant, real-time environment to test your patterns — highlighting matches as you type, so you can iterate quickly without needing to run your application.
Common RegEx Patterns Reference
| Pattern | Matches | Example |
|---|---|---|
\d+ | One or more digits | 123, 4567 |
\w+ | Word characters | hello, world_1 |
^ | Start of line | Beginning of string |
$ | End of line | End of string |
\b | Word boundary | Whole word match |
[a-z] | Character range | Any lowercase letter |
(?:...) | Non-capturing group | Group without capture |
(?=...) | Positive lookahead | Match before condition |
Frequently Asked Questions
Does this support .NET regex syntax?
Uses JavaScript's engine, compatible with most common .NET patterns. Some advanced .NET features like balancing groups differ.
What regex flags are supported?
g (global), i (case-insensitive), m (multiline), s (dotAll), u (Unicode mode).
How do I match a whole word?
Use word boundary anchors: \bword\b — this matches 'word' but not 'sword' or 'words'.
What is greedy vs lazy matching?
Greedy (*, +) matches as much as possible. Lazy (*?, +?) matches as little as possible. Add ? after a quantifier for lazy mode.
How do I match an email address?
A basic pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ — though full RFC 5322 compliance requires a more complex pattern.