Pattern / /
Test String
Matches
Highlighted Text

Getting Started with Regular Expressions

Regular expressions (regex) are patterns that match text. They're incredibly powerful for searching, validating, and transforming strings — but the syntax can be cryptic. This tester lets you build and debug patterns with instant visual feedback: matches highlight in real time as you type.

Quick Reference

  • . — matches any single character
  • \d — matches a digit (0-9)
  • \w — matches a word character (letter, digit, or underscore)
  • [abc] — matches any one of a, b, or c
  • a+ — matches one or more "a" characters
  • ^ and $ — match the start and end of a line
  • (group) — captures a group you can reference later

Common Patterns

Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
URL: https?://[^\s]+
Phone (US): \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}

This tester uses JavaScript's regex engine. If you're targeting Python or Go, the syntax is mostly the same but there are differences in lookaheads and named groups.