How to use the Regex Pattern Library
- Browse or filter the patterns.
- Read what the pattern accepts and its limitations.
- Copy it as JavaScript, Python or Java, and try your own values.
Why a pattern library rather than an AI regex generator?
Generated regular expressions often look right but fail on edge cases. Every pattern here comes with examples it must match and must reject, and those examples run as automated tests whenever the site is built. You can adapt them in the regex tester.
Validating Indian identifiers
Patterns for PAN, GSTIN, IFSC, PIN codes, mobile numbers and Aadhaar check the format only. A correctly formatted PAN can still be invalid or belong to someone else. Use official verification services where it matters, and handle identity numbers carefully — collect them only when you genuinely need them.
Frequently asked questions
Why don't the patterns use \d in Java?
They do — in Java string literals every backslash must itself be escaped, so \d becomes "\\d". The Java snippet does this for you.
Can I use these patterns commercially?
Yes. They're common, generic patterns; use them freely.
Is what I enter stored or sent anywhere?
No. Calculations and processing happen in your browser. Nothing you type is sent to our servers. Some tools remember your last input in this browser's local storage for convenience; you can clear it at any time.