
Explore how to use regex101 to test and understand regular expressions, including flavors, match vs substitution, global and multiline options, and the built-in debugger and quick reference.
Explore how regular expressions operate on a string, observe the matching steps, and use the rich x debugger to test matches and understand global flags.
Explore regex shorthand for character classes, including \d and \D, \w and \W, \s and \S, the dot wildcard, outside-bracket use, and negation.
Explore how alternation and parentheses constrain regular expressions to match street name variants, using character classes to handle case differences and digits, and strings like First Street or Fourth Street.
Explore core regex concepts, including the start and end anchors, character classes vs alternation, ranges and negated classes, and common metacharacters like \d, \w, and \s to write concise patterns.
Explore the zero or more quantifier (*) in regex, showing how it matches different digit counts, and learn when to use the asterisk and the dot and asterisk pattern.
Learn to build a practical regular expression that identifies urls, including http or https, optional www, domain, extension up to six letters, and optional port.
Use practical regex techniques to extract valid HTML text from a web scraper example by matching opening and closing tags, tag names, attributes, and capturing groups with backreferences.
Explore lookaround in regex, including positive and negative lookahead and lookbehind, and learn how combining them enhances pattern matching beyond basic character classes.
Explore lookahead assertions in regex, testing a pattern without consuming text. See examples with 'man' in superhero names and movie strings, and learn how capturing groups inside assertions reuse matches.
Explore matching euro price decimals with two digits using lookbehind and lookahead, ensuring decimals appear after a dot and exclude zero and double zero.
Explore look ahead and look behind as zero-length assertions that do not capture, learn their positive and negative variants, and how capturing groups can appear inside lookarounds.
Lookaround Cheat Sheet
Regular expression (regex) is not an easy topic and many people just ignore its existence until met with the necessity to use them. I heard many times the phrase "If you have a problem and you use regular expressions to solve that problem, then you have two problems." and I really hate it. I then realized that people who say that are the people who do not know how to write proper regular expressions.
That is why I'm sharing the knowledge on the most important concepts of regex. After you grasp them, writing regular expressions will become quite easy, but the most important part is that YOU WILL SAVE AN INCREDIBLE AMOUNT OF TIME using regex. Tasks that took 1 hour to complete, now might take minutes or even seconds. With practice, the amount of time you save for yourself will be increasing.
That is why this course is very practical and will focus on real-life examples. It is appropriate for any knowledge level: beginner, intermediate or advanced and contains regular expressions cheat sheets. The content is also divided into three levels: Basic, Intermediate, and Advanced. In each of those levels, increasingly difficult regular expression concepts will be discussed in a practical manner through exercises. We will always be focusing on how we can write and apply our regular expressions to real-life examples so when you finish the course, you will have the experience required to write any regular expression you might need. And there are more than 45 examples that will help you with that!
You will learn:
- regular expressions basics;
- regular expressions quantifiers (number of characters): ranges, at least one, one or none, etc.;
- regular expressions shortcuts through character classes and groups;
- regular expressions alternation;
- regular expressions parenthesis and how they are used for in easy and complex situations;
- regular expressions lookaround: lookahead and lookbehind.
You will practice and learn how to write:
- regular expressions for URL validation;
- regular expressions for password validation;
- regular expressions for numeric data validation and extraction;
AND MUCH MORE!
The course can be used to apply the regular expressions in Python, Java, Javascript, Golang, C, C#, or any other programming language. Depending on the language, you may need to escape certain characters in your regex for it to compile correctly. Make sure to always test your regular expressions using unit tests.
What you will learn is also applicable outside the programming languages. Any tool that supports regular expressions will allow you to benefit from this course. Think about regular expressions for grep, excel, or even google analytics. The regular expressions cheat sheets that are provided at the end of each section will help you to hold the knowledge outside the course!