The Regular Expression (RegEx) Cheat Sheet you always wanted

I get it even though Regex is incredibly useful, it is extremely hard to master! This is a cheat sheet that provides the most common RegEx use cases that will help you whenever need a sneak peek at the Regex syntax!

NOTE: Medium doesn’t support a native tables, so the tables below are screenshots. If you want it in tabular format, check out






By default quantifiers are greedy (they try to match as much of the string as possible). The ? character after the quantifier makes the quantifier non-greedy (it will stop as soon as it finds a match).

For Example: \d+? for a test string 12345 will match only 1, but \d+ will match the entire string 12345


Flags are put at the end of the regular expression. They are used to modify how the regular expression behaves.

For Example: /a/ for a test string a will match a only, but adding the flag i (/a/i) would match both a and A

That’s all folks!

Research says, writing down your goals on pen & paper makes you 21% to 39% more likely to achieve them. Check out these notebooks and journals to make the journey of achieving your dreams easier:

Follow me for weekly new tidbits on the domain of tech!

Need a Top Rated Front-End Development Freelancer to chop away your development woes? Contact me on

Want to see what I am working on? Check out my and

Want to connect? Reach out to me on

I have moved to Bali, Indonesia as a Digital Nomad. Follow me on to check out what I am up to.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tapajyoti Bose

Top Rated Freelancer || Blogger || Cross-Platform App Developer || Web Developer || Open Source Contributor || FIRE Enthusiast