Regex and cron

Common Regex Patterns, Tested and Explained

Copy-ready regular expressions for the validations every app needs, each with a tested example table and code for five languages.

  • Free foreverNo trial, no paywall, no usage limits.
  • No sign-upOpen the page and start. We never ask for an email to use a tool.
  • PrivateEverything runs in your browser. Your input is never uploaded or stored on our servers.
  • Works offlineOnce the page has loaded, the tool keeps working without a connection.

25 patterns

Need a secure web app built around this? Talk to our team

Quick answer

Playxoft's free Regex Pattern Library collects 25 regular expressions developers reach for most often, from email and URL validation to UUIDs, IP addresses, dates and postcodes. Every pattern has its own page with a token-by-token explanation, a table of strings it accepts and rejects that is verified by automated tests, the caveats that matter, ready-to-use code for JavaScript, Python, Go, C# and PHP, and a live tester pre-filled with examples.

  • 25 tested patterns
  • Search and filter
  • Explained token by token
  • Code in 5 languages

How to use the regex pattern library

  1. 1Type what you want to validate (email, IPv4, date…) into Search patterns, or pick a category.
  2. 2Open a pattern to see how it works, which strings it accepts and rejects, and its known limits.
  3. 3Copy the pattern, or the snippet for your language from the code section of its page.
  4. 4Edit the sample text in the tester on that page to try your own values before you ship.

Which regex should I use for common validations?

Pick the page for the data you are checking. Each one explains the trade-offs it makes, such as accepting plus-addressed emails or rejecting IPv4 octets with leading zeros.

Every pattern is written for JavaScript's engine and translated for the other languages on its page. Where an engine cannot express a construct (Go has no lookarounds or backreferences, for example), the page says so and shows the workaround.

How were these regex patterns tested?

Each page has a table of inputs with the expected result and the reason, for example jane..doe@example.com → no match, because two dots in a row are not allowed. Those tables are not just documentation: our automated test suite runs every row against its pattern before each release, so a pattern change that breaks a row is caught before it reaches the site.

The examples deliberately include the edge cases that break home-made patterns: leading zeros in IP addresses, the Mastercard 2-series, February 31st, apostrophes in email addresses, and Unicode digits that some engines treat as numbers. Where a pattern accepts something that is still wrong (an impossible date, a card number with a bad checksum), the table shows it as a match and the page explains the extra check you need.

When should you not use a regex for validation?

A regex checks the shape of a string. Some questions need more than shape:

  • Does this email address exist? Send a confirmation link. See the email pattern for why RFC 5322 regexes are a trap.
  • Is this a real calendar date? Parse it: February 31st has the right shape. See dates.
  • Is this phone number valid in its country? Use libphonenumber, then store E.164. See phone numbers.
  • Is this URL safe to fetch? Parse it with the URL API and block private addresses. See URLs.
  • What is inside this HTML? Use DOMParser, not regex. See HTML tags.

Use the regex for fast, friendly feedback in the form, and the parser or a real-world check for the decision.

Frequently asked questions

Yes. Copy them into any project. Each page shows the pattern, an explanation and code for five languages, so you can see exactly what you are adopting.
JavaScript (ECMAScript), which is also what the tester runs. Each pattern page translates the pattern for Python, Go, C# and PHP and notes engine differences such as Go's lack of lookarounds.
Every pattern page has the regex tester built in, pre-filled with the examples. Replace the test text with your own values, one per line, and matching lines are highlighted as you type.
Yes, use the contact link on this page. Meanwhile, the regex tester explains any pattern you paste in plain English, which is a quick way to check one you found elsewhere.
They express rules that are otherwise awkward, such as a total length limit for usernames or consistent separators in MAC addresses. Each page explains the construct, and its Go code notes when RE2 cannot run it.

Last updated by the Playxoft engineering team.

From the engineers who built this tool

Building something bigger than a quick fix?

Auth, payments, dashboards and security are where web apps get hard. We have shipped them many times. Share your idea and we will map out a realistic plan and estimate, free and with no obligation.

More free tools

See all tools

Cron Expression Generator

New

Build and explain cron schedules, see the next runs in any time zone, copy platform snippets.

Open tool

SQL Formatter

Beautify or minify SQL in 12 dialects, with keyword case, indent and line:column errors.

Open tool

cURL to Python Converter

New

Convert cURL commands into Python requests or httpx code with params, json, files and auth.

Open tool

cURL to Fetch Converter

New

Turn any cURL command into JavaScript fetch() code with headers, JSON, forms and auth.

Open tool

cURL to Axios Converter

New

Convert cURL commands into an Axios request config with params, data, auth and timeouts.

Open tool

SQL to Prisma Converter

Turn SQL DDL into a schema.prisma with native types, relations and enums.

Open tool