Regex Tester & Debugger
Test and debug your regular expressions in real-time. Our free tool provides live match highlighting, group information, and a handy cheatsheet for JavaScript regex.
Match Information (0 matches)
Regex Cheatsheet
| Character | Description | Example |
|---|---|---|
| . | Any character except newline | /h.t/ matches "hot", "hat" |
| \d | Any digit (0-9) | /\d{3}/ matches "123" |
| \w | Any word character (a-z, A-Z, 0-9, _) | /\w+/ matches "hello_123" |
| \s | Any whitespace character (space, tab, etc.) | /hello\s/ matches "hello " |
| [abc] | Matches any one of the enclosed characters | /[aeiou]/ matches any vowel |
| (abc) | Capturing group | /(\w+)\s(\w+)/ captures words |
| * | Zero or more of the preceding character | /a*/ matches "", "a", "aa" |
| + | One or more of the preceding character | /a+/ matches "a", "aa" |
| ^ | Start of the string (or line with 'm' flag) | /^Start/ matches "Start of..." |
| $ | End of the string (or line with 'm' flag) | /end$/ matches "...the end" |
Frequently Asked Questions
What is a Regular Expression (Regex)?
A regular expression is a sequence of characters that specifies a search pattern. It's a powerful tool used in programming and text editing to find, replace, and manipulate text based on complex patterns.
What do the flags (g, i, m, s) mean?
Flags modify the search behavior. 'g' (global) finds all matches instead of just the first. 'i' (case-insensitive) ignores letter casing. 'm' (multiline) allows start (^) and end ($) anchors to match the start/end of lines, not just the whole string. 's' (dotall) allows the dot (.) to match newline characters.
Why does my browser freeze with certain patterns?
This can happen due to a phenomenon called 'catastrophic backtracking,' where a poorly written regex can take an extremely long time to process certain strings. This often occurs with nested quantifiers, like (a*)*. If this happens, try to make your pattern more specific.
Private and Secure
This tool is powered by your browser's own JavaScript engine. No data is ever sent to our servers, so you can test sensitive information with complete confidence.