Regex Pattern Library

Browse ready-made regular expressions for common tasks — emails, URLs, dates and more.

Patterns you don't have to write

Many regex needs are common enough that a proven pattern already exists — matching an email, a URL, a phone number, a date, a postcode. Rather than write and debug one from scratch, this collects tested patterns for those everyday tasks, so you can grab a working expression and adapt it to your case.

Find the pattern you need and copy it into your code.

Use a pattern, but understand it

A ready-made pattern is a head start, not a blind copy. Regex for things like email addresses is famously imperfect — a fully correct email pattern is monstrous, so most practical ones deliberately accept the common cases and reject the obvious junk rather than being exhaustive. Take a library pattern, test it against your real inputs, and adjust it to your needs. Knowing roughly how it works also means you can fix it when your data has a case the original author did not anticipate.

Frequently asked questions

Are these patterns guaranteed to be perfect?

No — common patterns like email matching are pragmatic rather than exhaustive. Test one against your real inputs and adapt it.

How should I use a library pattern?

As a tested starting point: copy it, check it against your data, and adjust it to your specific case.

Is anything uploaded?

No. It is a reference that runs in your browser.

More Developer tools