SG Regex Tester
SG UtilitySanchitGurukul•Technology • Education • Innovation
Regex Tester
Build, test, explain and troubleshoot regular expressions with live match details.
Test Text
Your original text remains unchanged.
Characters 0Lines 0Matches 0Groups 0
Match Preview
Matches are highlighted without modifying source text.
Matched text will appear here.
Enter a pattern and test text to begin.
Match Details
Index, full match, capturing groups and named groups.
| # | Index | Match | Groups |
|---|---|---|---|
| No matches yet. | |||
Regex Replace
Supports JavaScript replacement tokens such as $1, $& and named groups.
Regex Split
Split the test text wherever your regex matches.
- No split result yet.
Pattern Explanation
A practical token-by-token explanation for common JavaScript regex syntax.
Enter a pattern to see an explanation.
Test Cases
Verify whether separate strings should match or not.
Quick Examples
Regex Cheat Sheet
. any char\d digit\w word char\s whitespace^ start$ end* 0+ times+ 1+ times? optional{n,m} range[abc] char set(...) capture(?:...) non-capture(?<name>...) named groupImportant: This tester uses the JavaScript regular-expression engine in your browser. Regex syntax can differ between JavaScript, PCRE/PHP, Python, Java, .NET and other engines. Avoid running untrusted complex patterns against very large text because some regexes can cause heavy backtracking.
