How to Use
Enter your regex pattern or select one of the ready presets.
Toggle active search flags (g, i, m, s, u) using the quick buttons.
Paste test text to see highlighted matches and capture groups computed in real time.
Switch to the "Substitution / Replace" tab to test pattern replacement.
What Is This Tool?
A Regular Expression (Regex) is a sequence of characters that forms a search pattern for text validation, extraction, and string transformation in software engineering.
Why It Matters
Regexes are essential in web development. Testing patterns against sample strings prevents subtle bugs and edge-case errors before deploying to production.
How Does the Substitution (Replace) Tab Work?
The Substitution tab lets you test replacing matches found in your text with a formatted string. Use variables like $1 and $2 to reorder capture groups defined in parentheses (), $& to re-insert the entire matched text, or static text like masks [REDACTED].
What Are Capture Groups ($1, $2)?
When you enclose parts of your regex in parentheses (e.g., (\d{4})-(\d{2})-(\d{2})), each pair of parentheses creates a numbered capture group ($1 for year, $2 for month, $3 for day). In the replacement pattern, referencing $3/$2/$1 immediately reformats dates and numbers.