Regex Tester

Regex Pattern

/
/g

Load Example:

Test String

Highlighted Matches

Match Details (0)

No matches found

About Regex Tester

This tool helps you test and debug regular expressions (regex). Regular expressions are patterns used to match character combinations in strings, essential for tasks like data validation, text parsing, and search operations.

Regex Flags:

  • g (global) - Find all matches rather than stopping after the first match
  • i (ignoreCase) - Case-insensitive matching
  • m (multiline) - Treat beginning/end characters (^ and $) as working over multiple lines
  • s (dotAll) - Allows . to match newline characters
  • u (unicode) - Treat pattern as a sequence of Unicode code points
  • y (sticky) - Matches only from the index indicated by the lastIndex property

Common Regex Patterns:

Email Validation:
(\w+)@([\w-]+)\.([a-z]{2,})
URL Validation:
(https?:\/\/)?([\w\.-]+)\.([a-z\.]{2,6})([/\w\.-]*)*\/?
Date Format (YYYY-MM-DD):
(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])
Phone Number:
\+?\d{1,4}[-.\s]?\(?\d{1,3}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}
IP Address:
(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)
HTML Tag:
<([a-z]+)([^<]+)*(?:>(.*?)<\/\1>|\s+\/>)

Regex Special Characters:

. - Any character except newline
\w - Word character [a-zA-Z0-9_]
\d - Digit [0-9]
\s - Whitespace character
^ - Start of string/line
$ - End of string/line
* - 0 or more occurrences
+ - 1 or more occurrences
? - 0 or 1 occurrence

All regex testing is performed in your browser. Your patterns and test data are never sent to any server.