Skip to main content Accessibility Feedback

Regex cheatsheet

There’s an old saying in computer science:

If you use regex to solve a problem, now you have two problems.

A regex, or Regular Expression, is a way of matching patterns in a string. Earlier this year, I shared a few videos from Steve Griffith on vanilla JS regex basics.

Regex can be really difficult, but jokes aside, sometimes it honestly is the best way to solve a problem.

One of the toughest things about using regex is figuring out what patterns to actually use to do what you’re trying to do.

Fortunately, the amazing Emma Bostian has you covered! Emma’s regex cheatsheet includes tons of patterns for common tasks you might use regex for. It’s a super handy resource.

Click here to check it out.