Common Regex Patterns

A searchable cheat sheet of regular expressions for phone numbers, email addresses, ID numbers, dates, IP addresses and more, with a built-in tester.

FreeOnline Tool
Loading…

How to Use

The page lists every regex category by default, with several common patterns under each one. Each entry shows the pattern's name, the regular expression itself and sample data.

Search: type a keyword into the search box at the top (phone, email, date and so on) to filter the patterns instantly.

Copy and test: click the copy or test button on the right of a row, and the pattern is dropped into the regex input in the tester at the bottom and matched once automatically.

Online testing: in the tester at the bottom you can enter your own expression and test text, then see the result line by line, with a green check for a match and a red cross for no match.

Features

  • Browse by category: organized into phone numbers, email addresses, ID numbers, numeric values, dates and times, networking, passwords and more so you can find the right pattern fast
  • Live search: fuzzy search by name, expression or sample data, filtering as you type
  • One-click copy: copy any expression to the clipboard with a single button
  • Built-in tester: check whether an expression matches your target text without leaving the page
  • Sample data: every pattern ships with example data to make its purpose clear

Use Cases

Building form validation
Developers can grab a phone or email pattern quickly while writing validation logic.
Extracting data
Analysts can pull values matching a specific format out of raw text.
Log parsing
Operations engineers can reference common patterns while configuring log parsing rules.
Learning reference
Students and beginners get an instant reference while learning regular expression syntax.

FAQ

Can I use these patterns in production directly?
Most of them are widely proven and can be used as they are, but you should still adjust the edge cases to match your business rules — for example adding new mobile number prefixes as carriers introduce them.
How do I test a regex I wrote myself?
Type your expression into the tester at the bottom of the page, add your test text, and the results are shown line by line so you can verify the pattern behaves as intended.
Why are some of these expressions so long?
Long patterns usually exist to cover more edge cases, such as validating the 0 to 255 range in an IP address. They are harder to read but match more accurately.
Is the pattern library kept up to date?
Yes, new patterns are added over time and existing ones are refreshed, particularly for things that change such as mobile number prefixes and country codes.