Regex Pattern Library: Ready Patterns for Email, Phone, PIN, PAN and GSTIN

What is it?

The Regex Pattern Library gives tested regular expressions for common data, which you can Test it (one value per line) before using.

Who is it for?

Developers and form builders validating emails, phones, PINs, PAN, GSTIN and IFSC, and data analysts cleaning lists.

Patterns included

  • Email addresses, website addresses, international phone numbers (E.164) and Indian mobile numbers.
  • Postal codes: India PIN, US ZIP, UK postcode, Canada postal code.
  • Indian IDs and codes: PAN, GSTIN, IFSC and vehicle registration numbers.
  • Technical values: IPv4 addresses, dates (YYYY-MM-DD), usernames, file extensions and UUIDs.

How to use it

  1. Pick a pattern and copy it.
  2. Paste your own values in the test box, one per line; the Result shows which match.

Important limits

  • A pattern checks the format, not that a value is real: a well-formed PAN or email may not exist. Verify through the official service or a confirmation email.
  • Email regex can’t follow every rule in the standard. Keep it simple and send a confirmation link.
  • Patterns here use JavaScript syntax; most work in Python, PHP and Java with small changes (escape backslashes in string literals).

To build or debug your own pattern, use the Regex Tester.

Example

To check PIN codes in a form, take the India PIN pattern and test values: 141001 matches; 041001 (PINs never start with 0) and 14100 (5 digits) don’t. The same check catches typing mistakes before a form is submitted.

Using patterns in forms

In HTML, put the pattern in <input pattern="…"> (without the slashes) so the browser checks it. Always check again on the server, because browser checks can be bypassed.

Errors and how to fix them

  • “Nothing found.”: no pattern matches your search word. Try a simpler word, such as “email”, “phone” or “date”.
  • A pattern rejects a value that looks right: patterns follow common formats. Test it with your own examples in the Regex Tester and adjust it.

Open the tool: Regex Pattern Library

Still stuck?

Contact support. Tell us which tool or page you were using, what you tapped, what you saw, and your phone or computer and browser (for example: Android phone, Chrome). We reply by email.

Questions, or an error not listed here?

Tell us in the comments: what you were doing, the exact message you saw, and your device and browser. We read every comment and add new fixes to this article.