Regex Tester

Regular expressions (regex) are a powerful tool for matching patterns in text.

No matches found

How to use regex

  1. Enter regex pattern
  2. Select match options (e.g. ignore case)
  3. Enter test string
  4. Click "Test match" to view results

Common regex examples

Email validation
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Match standard email address format
Chinese phone number
^1[3-9]\d{9}$
Validate Chinese mainland 11-digit phone number
Extract numbers
\d+
Match one or more consecutive digits
Remove whitespace
\s+
Match one or more whitespace characters