Skip to content
Explore the learning library ☟
SanchitGurukulTechnology · Education · Innovation Take a quiz

SG Regex Tester

SG UtilitySanchitGurukul•Technology • Education • Innovation

Regex Tester

Build, test, explain and troubleshoot regular expressions with live match details.

● Local & private
/ /

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.

#IndexMatchGroups
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.

  1. 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 group
Important: 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.

Namaste! I’m SG Saarthi 👋Need help learning or finding something?