4.82 out of 5
4.82
38 reviews on Udemy

Taming REGEX – A Complete Guide to Regular Expressions

Simple Regex examples in Python, PHP, HTML5, Sheets and PowerShell for you to better understand Regular Expressions.
Instructor:
Paul Ogier
317 students enrolled
English [Auto]
This Regular Expressions (Regex) course is not only designed to teach you regex but also designed to hone your knowledge by giving you real-world examples to work with.
Understanding regex is a powerful tool to have at your disposal and is a crucial skill set for IT professionals and people whose jobs entail data analysis.
Understanding regex is critical in using and utilising the full scope and functionality of some of the world’s most popular programming languages such as Python, PowerShell, Javascript, PHP etc.
You will learn the difference between Positive and Negative, Lookahead and Lookbehinds in Regex
Use Regular Expressions to fix and manipulate US and UK Dates
You will learn about Capturing Groups and Backreferences in Regex
Figure out Greedy, Lazy and Possessive Quantifiers

Now updated in July 2020.

 

Welcome to Taming.Tech’s REGEX Course. No previous Regular Expressions experience required!

Regular expressions are also referred to as Regex, Regexes or Regexp (sometimes called a rational expression)

This course is designed to advance you from beginner to proficient. It is laid out logically so that you can incrementally build your regular expressions knowledge. Essential foundations are established first to facilitate in-depth comprehension of this key skill.

The real world and real-life examples explored in this course will deepen your understanding of REGEX and how to apply what you’ve learnt authentically and appropriately. Experimentation with a new skill is vital in exercising and integrating wider application; which is why we’ll explore practical examples because it ingrains the information contained here.

Our world is pretty much run by data now and those that know how to intelligently interrogate and manage data have a distinct advantage. Regular expressions unlock the powerful possibilities of any data set.

Data analysis is vital in a variety of industries and circumstances and being able to deploy and utilise this formidable tool will strengthen your skills set, enhance your confidence and give you an edge.

 

HOW CONFIDENT AM I? Take this course. If you don’t learn everything you need to know about Regular Expressions (Regex) in the next 30 days, I’ll refund every penny!

 

ASK YOURSELF:

Are you battling to learn Regex?

Have you tried many Regular Expression courses on Udemy and YouTube and you are still not getting it?

Are you a programmer that avoids using Regex because you are not confident?

Are you a beginner and you have heard about this and are not sure where to start?

As a Data Scientist, you know that this will help you query and clean data, but you don’t have a proper foundation to start from.

Have you started programming in Python, PHP, JavaScript, Java etc and you need to have a better understanding of Regular Expressions?

Are you using Google Sheets to clean data up and you would like to make the process faster?

Are you a system administrator using PowerShell and you would like to run scripts that make your job easier?

Do you know REGEX? How about advanced REGEX? Date Matching? Regular Expressions with Leap Years?

If you have answered YES to any of these questions – then you NEED this course!

 

What questions do we answer?

  • Is regex case sensitive?
  • Are regex the same for all languages?
  • Is regex evil? 🙂
  • How do Regular Expressions work in Python?
  • What are the special characters in Regex?
  • Can Regex contain spaces?
  • How to exclude a string from Regex?
  • How to escape a backslash in Regexes? And what regex characters need to be escaped.
  • What are Regexp groups?
  • When was Regex created?
  • What are the differences between Greedy, Lazy and Possessive Quantifiers?
  • And many more.

 

And the full 30 day no-questions-asked Udemy instant guarantee is your assurance of the quality and potential of this course.

Get started today by clicking “Buy Now” and get full, lifetime access to this unique Regular Expressions (Regex) course with all future updates and all current and future course materials included!

 

Here are some recent reviews for this Regex course…

5 Star – Regex can be a tricky beast to tame, but this course certainly helps one to get to grips with it. The course goes in to great depth and has plenty of good examples to explore. I was particularly interested in the Python and PowerShell sections, however the entire course is very informative. – Bryan Smith

 

5 Star – Regex annoyed me. Then I found Paul’s course. Well worth the money and time invested. The reason it’s worth it isn’t because of the content, no the content is actually tedious and annoying… it’s worth it because of how he positions the content, walks you through it and explains it in an INTUITIVE way. If more people taught the way Paul does, we’d be a smarter planet. Also the jokes are on ‘a neighborhood of dads’ level. – Eugenio Parages

 

Let’s get started!

 

The Basics

1
Introduction

Welcome to the course! Let's figure out what Regex is and how it can help you.

2
What is Regex and the History of Regex and Tools

Did you know that Regular Expressions, regex or regexp or sometimes called a rational expression, is a sequence of characters that define a search pattern? Usually, such patterns are used by string searching algorithms for "find" or "find and replace" operations on strings, or for input validation.

3
REGEX - Cheat Sheet
4
Setting up Regex101.com

Let's look at regex101.com and see how you can use it.

5
Literal Characters

The most basic regular expression consists of a single literal character, such as "a". It matches the first occurrence of that character in the string.

6
Metacharacters or Special Characters

Because we want to do more than simply search for literal pieces of text, we need to reserve certain characters for special use. There are 12 characters with special meanings: the backslash , the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the opening parenthesis (, the closing parenthesis ), the opening square bracket [, and the opening curly brace {, These special characters are often called “metacharacters”. Most of them are errors when used alone.

7
The Caret

A caret ( ^ ) is fancy and can be used for negating and to symbolise the beginning of a string and also as a literal character.

8
Intro to PowerShell and Literal Matches

Let's try a practical example using PowerShell on Windows. If you want to test this on a macOS or Linux machine, please check the resources.

9
Metacharacters or Special Characters - More Advanced

Most metacharacters need to be escaped to be used as a literal character

10
The period Metacharacter

In regular expressions, the dot or period is one of the most commonly used metacharacters.

The dot matches every single character, almost like a wildcard. The only exception is a line break character.

11
Demo in Google Sheets - Example 1

Here we look at a practical example on how to use your new knowledge of regex and test the query with Google sheets.

12
Section 1 - Quiz

Use this Quick Quiz to test your knowledge before moving onto the next section.

Metacharacters, Character Sets, Character Ranges and Modes

1
More Metacharacters - Shorthand Character Classes

We look at shorthand character classes d D w W s S

2
Non-Printable Characters

We focus on the most used non-printable characters t n v f r

3
Character Sets

With a “character class” or “character set”, you tell the regex engine to match only one out of several characters. Simply place the characters you want to match between square brackets.

4
Character Ranges

You can use a hyphen inside a character set to specify a range of characters. [0-9] matches a single digit between 0 and 9. [a-z] matches a single character between a and z case-sensitively.

5
Negating a Character Set or Range

So this is really the opposite of the previous lesson. Whatever has a ^ caret in front of it is negated, it is not included.

6
Using Metacharacters inside a Character Set or Range

Here we will be using a for escaping characters to make them literal, using - for ranges ^ for negating and using the ] literally.

7
Shorthand Character Classes

We look at defining the shorthand character classes now, with the ranges and negated sets in.

8
Demo in Google Sheets - Example 2

Going to the practical examples with the Google Sheets again, this time we go further into cleaning your data in names and email addresses. 

9
Section 2 - Quiz

Modes, Anchors and Word Boundaries, Quantifiers, backreferencing

1
Modes / Flags

We look at the most common flags or modes in regular expressions.

2
Anchors / Positional Anchors

Anchors are weird. They do not match any character at all. Instead, they match a position before, after, or between characters. They can be used to “anchor” the regex match at a certain position.

3
Word Anchors and Input file boundaries
4
Advanced Anchors and Word Boundaries
5
Repetition with Quantifiers - the ? Quantifier

In this lesson, we will be looking at the ? Quantifier. This is a greedy quantifier.

6
Repetition with Quantifiers - the * Quantifier

In this lesson, we will be looking at the * Quantifier. This is a greedy quantifier.

7
Repetition with Quantifiers - the + Quantifier

In this lesson, we will be looking at the + Quantifier. This is a greedy quantifier.

8
Limiting the repetition

Want to limit the repetition? This is the lesson fro you!

9
Removing Extra Whitespace Characters

Don't you find that spaces mess with your data? Yes? Well, let's clean them up.

10
Greedy and Lazy Quantifiers

This lesson on repetition operators or quantifiers explains the difference between greedy, lazy and Possessive. Greediness and laziness determine the order in which the regex engine tries the possible permutations of the regex pattern. A greedy quantifier first tries to repeat the token as many times as possible, and gradually gives up matches as the engine backtracks to find an overall match. A lazy quantifier first repeats the token as few times as required, and gradually expands the match as the engine backtracks through the regex to find an overall match.

11
Possessive Quantifiers
12
Google Sheets Example 3

Hey, these sheet examples make me realise how much we have learned. I hope it does it for you too.

13
Capturing Groups and Backreferences - Simple

By placing part of a regular expression inside round brackets or parentheses, you can group that part of the regular expression together. This allows you to apply a quantifier to the entire group or to restrict alternation to part of the regex.

14
Capturing Groups and Backreferences - Properly Formatted
15
Capturing Groups and Backreferences - Naming Groups
16
Alternation with The Vertical Bar or Pipe Symbol

Do you want one or the other? This is alternation!

17
Non-capturing Groups

Do you need a group, but you don't want to do anything with it?

18
PowerShell with Groups

Following on from our previous PowerShell example, we now use groups in PowerShell. Will the excitement ever end?

19
Google Sheets Example 4

Our names and email addresses are almost clean. This is the next step.

20
Section 3 - Quiz

Positive and Negative Lookahead and Lookbehinds

1
Positive Lookahead and Lookbehind

Lookahead and lookbehind are collectively called “lookaround”.  The difference between these and a ^ symbolising the start of a string or line, is that lookaround actually matches characters, but then gives up the match, returning only the result: match or no match. Lookarounds allow you to create regular expressions that are impossible to create without them or would be very difficult.

2
Negative Lookahead and Lookbehind

This is like the previous lesson, but are the negatives.

3
Lookaround Examples

Let's try and make these easy to understand.

Basics Complete

1
Definitions Complete - Congratulations

You have made it! Now look at the rest of the lessons and see which ones you want to do.

Advanced Examples

1
Hexadecimal Colours

Get HTML colour codes and Hex colour codes and test if they are valid. Let's go!

2
IPv4 Matching
3
Date Matching and Manipulation

Are you dealing with US or UK date formats? Do you need to change it to your format or even the universal date format? Regex can help.

4
How to reference capture groups on REGEX101 - Solved by Bryan Smith in Q&A

Bryan, one of the students, figured out how to reference on REGEX101.

5
Date Matching - Very Advanced

This is as much as you might ever need to know about how to match dates using Regex.

Examples and Exercises - Installing PHP, Python and Visual Studio Code

1
Installing PHP

Do you need to run PHP on your Windows machine? Not to worry, this simple lesson will show you how to have a local web server set up and running in no time.

2
Installing Microsoft Visual Studio Code for Python and PHP

I love Visual Studio Code. Let's install it and use it for PHP, Python, HTML5 etc

3
Installing Python
4
Testing Python in Microsoft Visual Studio Code

Password Matching

1
REGEX - Password Matching
2
Password Matching - PHP
3
Password Matching - Python
4
Password Matching - HTML5

Email Matching

1
REGEX - Email Matching

Let's break down matching of email addresses.

Q&A Answers

1
How to match for double letters - Question from Eugenio Parages

Question from Eugenio Parages in the Q&A section of the course.


Double Letter Detection

Could you do an example as the one below to find double letters please?


test_cases = [

              "I'm going to read a book.",

              "Green is my favorite color.",

              "My name is Aaron.",

              "No doubles here.",

              "I have a pet eel."

             ]

for tc in test_cases:

    print(re.search(r"(w)1", tc))

Bonus

1
Bonus Lesson

You have made it to the end. Please see the attached resources for the best courses to carry on with your learning.

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.8
4.8 out of 5
38 Ratings

Detailed Rating

Stars 5
27
Stars 4
11
Stars 3
0
Stars 2
0
Stars 1
0
4a6672ddfcbf564e71e91433345e9e95
30-Day Money-Back Guarantee

Includes

7 hours on-demand video
2 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion
Hey Wait!

Get our latest Podcast episodes, Tutorials and discount coupons.