#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · SEARCHABLE

Regex Cheat Sheet: Every Token You Need, Plus Ready-Made Patterns

Look up regex syntax fast and test ready patterns for Indian formats like PAN, PIN and mobile numbers.

  • 🔎 48 tokens explained
  • 🇮🇳 PAN, GSTIN, IFSC, PIN
  • ✅ Test any pattern

How to use the Regex Cheat Sheet

  1. 1. Search or filterType a word like boundary or lookahead, or pick a category.
  2. 2. Pick a ready patternChoose a format such as Indian mobile number.
  3. 3. Test itType your own text to see if it matches, or download the sheet.

What the sheet covers

The 48 entries are grouped into characters (\d, \w, \s, .), sets ([a-z], [^0-9]), anchors (^, $, \b), quantifiers (*, +, ?, {2,4} and lazy versions), groups and back-references, lookahead and lookbehind, the seven JavaScript flags (g, i, m, s, u, y, d) and the JavaScript methods that use regex: match, matchAll, test, replace, split and exec.

Each token comes with a short example, such as colou?r matching both color and colour, or \d+(?=%) finding 50 in "50%".

Ready-made patterns, tested

The 14 patterns each come with one example that matches and one that doesn't, and all of them are checked against those examples:

  • Indian mobile: ^[6-9]\d{9}$ accepts 9876543210 and rejects 1234567890, because Indian mobile numbers start with 6–9.
  • PIN code: ^[1-9]\d{5}$, six digits with no leading zero.
  • PAN: ^[A-Z]{5}\d{4}[A-Z]$, like ABCDE1234F.
  • IFSC: four letters, a 0, then six letters or digits, like SBIN0001234.
  • Plus GSTIN, email, dates, 24-hour times, strong passwords, URLs, hex colours, IPv4 addresses and usernames.

These check the format only: a PAN-shaped string might not be a real PAN. Write and debug your own patterns with the Regex Tester.

Frequently asked questions

Is regex the same in every language?

The basics are shared, but details differ. Lookbehind, named groups and flags vary between JavaScript, Python, Java and others. This sheet follows JavaScript.

Should I validate email with regex?

A simple pattern catches typos. The only real check is sending a confirmation email.

What is a lazy quantifier?

Adding ? after *, + or {} makes it match as little as possible, so <.+?> matches one tag instead of everything up to the last >.

Is the regex cheat sheet free?

Yes, it is free. Testing a pattern or downloading the sheet asks for your name and WhatsApp number once. After that, the regex cheat sheet and every other Uncodemy tool open with no form.

More free tools

See all free tools