Utilrix

Regex Generator & Cheatsheet

Ready-made regex for email, password, phone, PAN, Aadhaar, GST and more — copy instantly, or build your own without writing regex by hand.

Common

Email address

Standard email format (name@domain.tld).

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Matches

Strong password

Min 8 chars with a lowercase, uppercase, digit and symbol.

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Matches

Username

Letters, numbers and underscore, 3–20 characters.

^[a-zA-Z0-9_]{3,20}$
Matches

URL slug

Lowercase words separated by single hyphens.

^[a-z0-9]+(?:-[a-z0-9]+)*$
Matches

India

Indian mobile number

10-digit mobile starting 6–9, optional +91.

^(\+91[\-\s]?)?[6-9]\d{9}$
Matches

PAN card

5 letters, 4 digits, 1 letter (format only).

^[A-Z]{5}[0-9]{4}[A-Z]$
Matches

Aadhaar number

12 digits, optional spaces (format only, no checksum).

^\d{4}\s?\d{4}\s?\d{4}$
Matches

GSTIN

15-character GST identification number (format only).

^\d{2}[A-Z]{5}\d{4}[A-Z][A-Z\d]Z[A-Z\d]$
Matches

IFSC code

Bank IFSC: 4 letters, 0, then 6 alphanumeric.

^[A-Z]{4}0[A-Z0-9]{6}$
Matches

PIN code

6-digit Indian postal code (can't start with 0).

^[1-9][0-9]{5}$
Matches

Web & Network

URL (http/https)

Web URL starting with http:// or https://.

^https?:\/\/[^\s/$.?#].[^\s]*$
Matches

IPv4 address

Four 0–255 octets separated by dots.

^((25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(25[0-5]|2[0-4]\d|1?\d?\d)$
Matches

Hex colour

3- or 6-digit hex colour with a leading #.

^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$
Matches

Numbers & Dates

Number (integer/decimal)

Optional minus, digits, optional decimal part.

^-?\d+(\.\d+)?$
Matches

Date (YYYY-MM-DD)

ISO-style date format (format only).

^\d{4}-\d{2}-\d{2}$
Matches

Time (24-hour HH:MM)

24-hour clock time.

^([01]\d|2[0-3]):[0-5]\d$
Matches

Processed 100% in your browser — nothing you enter here is ever uploaded.

Common use cases

Validate a form field

Grab a battle-tested email, phone or password regex instead of writing (and mis-writing) your own.

Validate Indian IDs

Copy format checks for PAN, Aadhaar, GSTIN, IFSC and PIN codes for signup and KYC forms.

Build a quick custom rule

Generate a pattern like “6–10 letters and digits” by ticking a few boxes — no regex knowledge needed.

How to use the Regex Generator

Browse the ready-made patterns — email, password, phone, PAN, Aadhaar, GST, IFSC, URL, hex colour and more. Use the search box to find one fast.

Type in the test box under any pattern to check your own value against it — a green tick means it matches.

Click Copy to grab the regex, ready to paste into your code.

Need something custom? Open the "Build your own" tab, tick the character types and length you want, and the regex is generated for you — no regex syntax required.

To debug a complex expression against longer text, pair this with the Regex Tester.

Frequently asked questions

Related tools