Viewers: in countries Watching now:
Learn how to find and manipulate text quickly and easily using regular expressions. Author Kevin Skoglund covers the basic syntax of regular expressions, shows how to create flexible matching patterns, and demonstrates how the regular expression engine parses text to find matches. The course also covers referring back to previous matches with backreferences and creating complex matching patterns with lookaround assertions, and explores the most common applications of regular expressions.
In the last movie, we saw how regular expressions spread to a number of different languages. While most of them are attempting to offer Perl-compatible regular expressions, in reality they're all slightly different, and that makes sense. I mean each one was written by somebody different and has slightly different specifications, and sometimes the differences can be very subtle. Each implementation, or version, of the regex processor can be referred to as an engine. You may also here me call them flavors, because each engine is slightly different as if it comes in a different. Let's take a look at some of the most popular ones.
BRE is basic regular expressions like grep and POSIX ERE are extended regular expressions like egrep. Then there's Apache. Version 1 of Apache used POSIX EREs, Version 2 of Apache uses the PCRE library just like PHP, and then MySQL uses POSIX EREs. Now there're a lot more engines out there than these. These are some of the most popular ones. I wanted to highlight these in particular because I'm going to keep coming back to them throughout the tutorial and letting you know which versions of these support different features that we're going to be talking about.
Now it can be hard to talk about the differences between these different engines. As I said, there're some of the very subtle differences. There's also many engines and languages out there, and I only know a few those. And most importantly, we haven't covered any regular expressions syntax at this point. So even if I told you those differences, they wouldn't mean anything to you just yet. So here's what you need to know at this point. Most of the basic features of regular expressions are the same across all of these. The most notable exception would be old UNIX tools that use the POSIX BREs-- really the very, very early regular expressions.
Most everything else is going to be using EREs and Perl-compatible engines; most of times that's what we're going to have to work with. As we go, I'll highlight the syntax differences and the important exceptions that you need to know about. Also keep in mind that each of these languages is evolving, so supporting each one of them may change or improve over time. So, in every case you want to consult the documentation for that language or that engine to get the real facts about how things work. What I'll be giving you are the general principles of regular expressions that you should be able to take with you, regardless of which one of these languages that you work with.
There are currently no FAQs about Using Regular Expressions.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.