Regex Tester
Test regular expressions with live match highlighting and group extraction.
Common Patterns
Regex Quick Reference
| Pattern | Description |
|---|---|
| . | Any character except newline |
| \d \D | Digit / Non-digit |
| \w \W | Word character / Non-word character |
| \s \S | Whitespace / Non-whitespace |
| \b \B | Word boundary / Non-word boundary |
| ^ $ | Start / End of string (or line with m flag) |
| [abc] | Character class — matches a, b, or c |
| [^abc] | Negated class — not a, b, or c |
| a|b | Alternation — a or b |
| (abc) | Capturing group |
| (?:abc) | Non-capturing group |
| (?<name>abc) | Named capturing group |
| a? a* a+ | 0 or 1 / 0 or more / 1 or more |
| a{3} a{2,5} | Exactly 3 / Between 2 and 5 |
| a*? a+? | Lazy quantifiers (match as few as possible) |
| (?=abc) | Positive lookahead |
| (?!abc) | Negative lookahead |
| (?<=abc) | Positive lookbehind |
| (?<!abc) | Negative lookbehind |
What are Regular Expressions?
Regular expressions (regex or regexp) are patterns used to match character combinations in strings. They are one of the most powerful text-processing tools available and are supported by virtually every programming language.
A regex pattern describes a set of strings using a compact syntax of literal characters, character classes, quantifiers, and grouping constructs. The engine then searches through input text to find substrings that match the pattern.
Flags modify how the pattern is applied: g (global) finds all matches, i makes matching case-insensitive, m (multiline) makes ^ and $ match line boundaries, s (dotAll) makes . match newlines, and u (unicode) enables full Unicode matching.