Regex Generator
Ready regular expressions for emails, phones, dates, PAN, GSTIN and more: test them, and copy code for five languages.
Ready regular expressions for emails, phones, dates, PAN, GSTIN and more: test them, and copy code for five languages.
About this tool
Regex Generator gives you tested regular expressions for common jobs, so you do not have to write them yourself. Search or pick from 30 patterns: email addresses, web addresses and domains, Indian and international phone numbers, dates and times, whole and decimal numbers, amounts with Indian commas, percentages, colors, slugs, usernames, passwords with rules, UUIDs, hashtags, and Indian codes such as PAN, GSTIN, IFSC, PIN code and vehicle numbers. Each pattern comes with a short note, examples that match and examples that do not. Choose how you want to use it. Check a whole value adds the signs for start and end, which is right for a form field. Find in a text leaves them out and makes sure the match is not part of a longer word or number, which is right for searching a document. Then try your own values: one per line with a tick or a cross, or a text in which matches are highlighted. The code below is ready for JavaScript, HTML forms, Python, PHP and Java, with backslashes and quotes written as each language needs them. HTML forms deserve a note: browsers now read the pattern attribute in a stricter way and silently ignore a pattern they do not like, so the version for forms is adapted. Patterns for letters of any language use Unicode and match Hindi as well as accents; they need the u flag, or the regex package in Python, and the code includes it. All patterns were run against their examples in JavaScript, Python and PHP. Remember what a pattern can do: it checks the shape of a value. 2026-02-31 has the shape of a date, and an email address with the right shape may not exist. For important data, check the value as well, and always on the server too.

Search for email, date, PAN and more.
Check a value or find in a text.
Try your own values.
For five languages.
With good and bad examples.
Whole values or searching.
Ticks, crosses and highlights.
Written as each one needs.
Check, find and clean
Check a field before sending.
ExampleA PIN code has six digits and no leading zero.
Collect addresses from a text.
ExampleAll emails in a long page.
Find card or phone numbers.
ExampleReplace them before sharing a log.
Look for rows with a bad code.
ExampleGSTIN in a customer list.
Use the same pattern in two languages.
ExampleJavaScript in the page, PHP on the server.
See how a pattern is built.
ExampleCompare the two dates.
Patterns that behave
Names and addresses vary more than you think.
A check in the browser can be skipped.
Check dates and check digits in code.
Senior Software Engineer · Developer of Toolyconvert
Hemant developed Regex Generator and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.
Last updated 25 November 2026
Featured on
Toolyconvert is listed on these product directories and launch platforms.