Regex (regular expressions).
A set of symbols that can create infinite matches.

It works in almost every programming language.
And it's easier than it looks.
But once you learn it, you will look like a god to everyone else.

Why Regex?
Imagine this.
You are given a massive list of contacts with names and emails.

You are looking for a guy named Jo.

So you copy that string into an editor and search for it.

And BOOM - 100 matches.

Are there a hundred Jos?
No.
But there are lots of names that include the word.

How do you filter them?
If you know Regex, this is easy.
Wrap it with two special characters, and you get the exact match.
\bJo\bThis is called a word boundary.
This makes sure the characters before and after the word aren't letters.

There are many more expressions like this that take hours to learn.
But these are the four major ones you actually need.
Special Characters
Special characters match a group of characters.
They usually start with a backlash (\).
Here are a few examples:
\d matches numbers.
\w matches letters and numbers.
. matches all characters.

Character classes
You can also match specific characters with classes.
Use square brackets to create a class.
This matches any characters that are either S or u.

Group
To match the whole pattern, use a group.

Inside, you can use a logical or.
This matches both Sasuke and Suske.

Quantifiers
Finally, quantifiers.
They control how many times a pattern appears.
A plus sign means one or more.
An asterisk matches zero or more.
Curly braces let you specify the number.

And you have just learnt the fundamentals of regular expressions.
Find out why 100K+ engineers read The Code twice a week
Staying behind on tech trends can be a career killer.
But let’s face it, no one has hours to spare every week trying to stay updated.
That’s why over 100,000 engineers at companies like Google, Meta, and Apple read The Code twice a week.
Here’s why it works:
No fluff, just signal – Learn the most important tech news delivered in just two short emails.
Supercharge your skills – Get access to top research papers and resources that give you an edge in the industry.
See the future first – Discover what’s next before it hits the mainstream, so you can lead, not follow.
Fee from Anime Coders
PS: It’s a bit late but… Merry Christmas!


