Regular expressions (commonly shorted to “regex” or “regexp”) are sequences of characters that create search patterns. These search patterns can be powerful tools that help you to find and match text at scale so you can do things like validate, extract or replace that text.
They are really useful in programming but can be a bit intimidating if you’re not used to them. Here are a few good introductory courses and resources to get you started on learning how to use regular expressions.
Note that the exact syntax for using regular expressions can differ slightly by programming language, but the general principles are pretty much the same.
The best way to get comfortable with using Regular Expressions is to actually use them. Regex101 lets you create and test patterns in real time and gives you tips and hints. It’s a great resource to use in conjunction with one of the courses listed below.
RegexOne is a free online tutorial that lets you try out regular expressions as you learn them. It takes a very gentle step by step approach to build your understanding of regular expressions, so it’s great for anyone who is completely new to regular expressions.
It walks you through exercises and challenges to get you familiar with common regular expression patterns and uses.
If you find videos helpful, Scrimba’s course builds on freeCodeCamp’s regular expressions course with screencasts. It also includes an interactive in-browser console that lets you try out your regular expressions while you’re learning.
This text-based tutorial introduces you to the basics of regular expressions, but also goes beyond that to more advanced topics.
Once you’ve got a basic handle on regular expressions, this simple cheatsheet will help you remember the most common patterns.