Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Taming Regular Expressions (REGEX) - Complete Guide to Regex
Highest Rated
Rating: 4.6 out of 5(186 ratings)
1,293 students
Created byPaul Ogier
Last updated 7/2023
English

What you'll learn

  • 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.
  • 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.
  • Regex is critical in using the full scope and functionality of some of the world’s most popular 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

Course content

29 sections • 81 lectures • 8h 2m total length
  • Introduction4:15

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

  • What is Regex and the History of Regex and Tools4:39

    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.

  • REGEX - Cheat Sheet0:12
    1. Use online regex tools: There are many online tools that allow you to test your regular expressions. They provide an easy-to-use interface that shows you what your regex is matching.

    2. Keep it simple: Try to keep your regular expressions as simple as possible. Use basic patterns such as character sets, quantifiers, and anchors.

    3. Use capture groups: Use parentheses to create capture groups. This can help you extract specific parts of a match.

    4. Be specific: Be specific in your regular expressions. Instead of using a dot to match any character, use a character set to match only the characters you want.

    5. Use lookahead and lookbehind: Lookahead and lookbehind are powerful features that allow you to match patterns that come before or after a certain pattern.

    6. Use flags: Regular expressions have flags that modify their behavior. For example, the global flag can be used to find all matches in a string, and the case-insensitive flag can be used to make the regex case-insensitive.

    7. Test your regex: Always test your regular expressions on different inputs to make sure they work as expected.

    8. Use resources: There are many resources available online that can help you learn regular expressions. Use them to your advantage.

    9. Document your regex: Document your regular expressions by adding comments to your code. This will make it easier for others (and your future self) to understand what the regex is doing.

    10. Practice: Practice makes perfect. Regular expressions can be difficult to master, so the more you practice, the better you'll become.

  • Setting up Regex101.com4:00

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

  • Your Feedback is Very Important to us!0:22
  • Literal Characters4:29

    In regular expressions (regex), literal characters are characters that match themselves exactly, without any special meaning or interpretation. For example, the letter "a" in a regex pattern matches the literal character "a" in the input text.

    Literal characters can be combined with other regex elements, such as character classes, quantifiers, and anchors, to create more complex patterns that match specific text patterns.

  • Metacharacters or Special Characters4:31

    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.

  • The Caret2:19

    In regular expressions (regex), the "^" symbol has different meanings depending on its position within the pattern.

    When "^" appears at the beginning of a regex pattern, it represents the start of a line or string. This means that the pattern that follows must match the beginning of the line or string. For example, the pattern "^hello" would match the word "hello" only if it appears at the beginning of a line or string.

    When "^" appears inside a character set (enclosed in square brackets), it negates the character set. This means that the pattern that follows will match any character that is not in the set. For example, the pattern "[^abc]" would match any character that is not "a", "b", or "c".

    It's important to note that the "^" symbol has different meanings depending on its position within the pattern, so you need to be careful when using it. If you want to match the literal "^" character in a pattern, you can escape it with a backslash ().

  • Metacharacters or Special Characters - More Advanced6:26

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

  • Intro to PowerShell and Literal Matches3:42

    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.

  • The period Metacharacter6:49

    In regular expressions (regex), the "." (dot) metacharacter represents any single character, except for a line break. This means that the dot can match any character, such as a letter, number, or punctuation mark, except for a newline character.

    For example, the pattern "a.b" would match the string "acb", "a&b", or "a b", because the dot can match any character in between the "a" and "b".

    The dot metacharacter can also be combined with other regex elements, such as quantifiers and character classes, to create more complex patterns that match specific text patterns. For example, the pattern ".*" (dot and asterisk) would match any sequence of characters, including an empty string.

    It's important to note that the dot metacharacter matches only one character, so if you want to match multiple characters, you need to use a quantifier such as "*", "+", or "{n,m}".

  • Demo in Google Sheets - Example 13:54

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

  • Section 1 - Quiz

Requirements

  • A PC, Mac, Linux Machine.
  • An internet connection.
  • Familiarity with programming concepts.
  • A willingness to stay the course and follow all the lectures to the end.
  • No prior knowledge of Regular Expressions is required.

Description

Regular Expressions (REGEX) - A Complete Guide. 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 expert. It is laid out logically so that you can incrementally build your regular expressions' knowledge. Essential Regex 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 Regular Expression 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.


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!


Are you looking to solve some or all of these issues in your day-today job?

  1. Text search and manipulation: Regex can be used to search and manipulate text, including finding specific words or phrases, replacing text, and extracting data from a string.

  2. Input validation: Regex is useful for validating user input in web forms or other applications. You can use Regex to ensure that user input meets certain requirements, such as a specific format or range of values.

  3. Data parsing: Regex can be used to extract data from text files or other sources, such as logs, spreadsheets, or databases.

  4. Web scraping: Regex is an essential tool for web scraping, allowing you to extract data from HTML or other markup languages.

  5. Automated testing: Regex can be used to write automated tests for software applications, ensuring that the output of the application meets the desired format or requirements.


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!


What questions do we answer?

  1. What is a Regular Expression (Regex)? A Regular Expression, or Regex, is a sequence of characters that defines a search pattern. It is a powerful tool for matching and manipulating text.

  2. What is the syntax for writing Regex patterns? Regex patterns consist of a combination of characters and metacharacters that define the search pattern. The syntax for writing Regex patterns varies depending on the programming language or application.

  3. What are metacharacters in Regex? Metacharacters are special characters that have a specific meaning in a Regex pattern. Examples of metacharacters include "^", "$", ".", "*", "+" and "?".

  4. What are some common Regex use cases? Regex is commonly used for tasks such as validating user input, searching and replacing text, extracting data from text, and parsing log files.

  5. What is the difference between a greedy and non-greedy Regex pattern? A greedy Regex pattern matches the longest possible substring that satisfies the pattern, while a non-greedy pattern matches the shortest possible substring that satisfies the pattern.

  6. What is Regex Backtracking? Regex backtracking occurs when a Regex engine tries to match a pattern, but fails at some point, and then tries different combinations of the pattern until a match is found.

  7. What is Regex Lookahead and Lookbehind? Regex Lookahead and Lookbehind are called lookaround, and they allow you to specify a pattern to match only if a certain condition is met ahead or behind the pattern.

  8. What is Regex Character Class? Regex Character Class is a set of characters that can be used to match a single character from a given set of characters. For example, [a-z] matches any lowercase letter in the English alphabet.

  9. What is Regex Quantifiers? Regex Quantifiers specify the number of times a character or a group of characters can be repeated in a pattern. Examples of quantifiers include "*", "+", "?" and "{m,n}".

  10. 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!


Don't just take our word for it - our students consistently give us high marks for our engaging content, expert instruction, and practical approach. Join us today and see why our course is the go-to resource for learning Regex!


5 Star - Easy to follow and understand. Most of the questions I write down to ask end up answered at some point in the video. - Nicholas Wilson

5 Star - Articulate and easy to follow. Well recorded with quality microphone. Content is well constructed and builds up knowledge steadily and logically from zero - Robin Roberts

5 Star - Paul is the best instructor I've ever had on any online course. If you want to learn Regex, this is a course that you must to finish. - Aleksandar Zivanovic

5 Star - This course definitely breaks down RegEx into very digestible pieces and I actually used lessons learned in the first section to solve a problem at work! I highly recommend this course to anyone looking to learn RegEx! - N. Home

5 Star - One of the most fantastic course you can take to get you started on RegEx!!!! - Edj Wright

5 Star - This was an excellent course! Paul explains things in a way that makes the subject easy to follow. All you need to do is just practice and apply what you learn, and you'll be on your way leveraging this powerful tool/skill! - Adam Araujo

5 Star - This is by far the best overview I have found on the internet for Regular Expressions. - Blue Echo

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

5 Star - Everything was explained well in this course, would recommend for a beginner. - B Ganesh



Whether you're a beginner looking to get started with Regular Expressions, or an experienced programmer looking to expand your skills, our course has something for everyone. Sign up today and take the first step toward mastering Regex!


Who this course is for:

  • Anyone who wants to learn Regular Expressions.
  • Anyone who is looking for practical real-world examples of how to apply their REGEX knowledge once learnt.
  • ASPnet, Python, JavaScript, PHP Developers and programmers looking to enhance their skills to enable them to produce better applications.
  • Anyone who is involved in data analysis.