Regex Tester

Test and debug regular expressions

Pattern Status
Not tested
Matches Found
0
Flags
g

Regular Expression

Enter your regex pattern

//g

Replace

Replace matched text

Test String

Text to test against the pattern

Regex Reference

Character Classes

. - Any character
\d - Digit [0-9]
\w - Word [A-Za-z0-9_]
\s - Whitespace
\D - Not digit
\W - Not word
\S - Not whitespace

Quantifiers

* - 0 or more
+ - 1 or more
? - 0 or 1
{n} - Exactly n
{n,} - n or more
{n,m} - Between n and m

Test and debug regular expressions with real-time match highlighting. Write a regex pattern, provide test text, and see all matches highlighted instantly. View captured groups, test different flags (global, case-insensitive, multiline), and iterate quickly on complex patterns.

Key Features

  • Real-time match highlighting
  • Capture group display
  • Flag toggles (g, i, m, s)
  • Match count and positions
  • JavaScript regex syntax
  • Test against multiple lines

How to Regex Tester Online

  1. 1

    Enter regex pattern

    Type your regular expression.

  2. 2

    Enter test text

    Paste the text to test against.

  3. 3

    View matches

    Matches are highlighted in real time with group details.

Common Use Cases

  • Developing and debugging regex for form validation
  • Testing patterns for log file parsing
  • Building regex for find-and-replace operations
  • Learning regex with instant visual feedback
  • Validating email, URL, or phone number patterns

Frequently Asked Questions

What regex flavor is supported?
JavaScript regular expressions, which support lookaheads, lookbehinds (ES2018+), named groups, and Unicode escapes.
Can I test replacement strings?
This tool focuses on matching. For regex replacement, use the "Find & Replace Regex" text tool.

Related Developer Tools