Pattern / /
Test String
Matches
Highlighted Text
About Regex Tester

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.

Frequently asked questions

Which regex flavor does this support?

It uses the JavaScript (ECMAScript) regular expression engine — the same one that runs in browsers and Node.js.

How do I use capture groups?

Wrap part of your pattern in parentheses, and matched groups are listed for each match so you can see exactly what each group captured.

Is my test data private?

Yes. Matching happens entirely in your browser and nothing you type is sent anywhere.

Related tools

From the blog