Regex Tester

Enter an expression and test text to see live matches. Supports common flags plus email, phone, date, and URL examples.

Common regex examples

Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Phone: ^1[3-9]\d{9}$
Date: ^\d{4}-\d{2}-\d{2}$
Strong password: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$
URL: ^https?://[\w\-]+(\.[\w\-]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$
IP address: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b

How to test regular expressions

Enter a JavaScript regex, paste test text, and enable global, ignore-case, or multiline as needed. Results show match count and content so you can iterate on the pattern.

  • g: find all matches, not just the first
  • i: ignore English letter case
  • m: make ^ and $ match the start and end of each line
  • Built-in examples are starting points for debugging, not final validation rules

FAQ

Which flags are supported?

Supports common JavaScript flags g (global), i (ignore case), and m (multiline), which can be combined.

Does the regex run on a server?

No. The expression and test text run locally in your browser and are never sent to a server.

Why isn't there a match?

Check for missing escapes, incorrect ^ or $ boundaries, and whether flags match the test text line breaks and casing.