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 learned about literal characters, the fact that an A matches an A and a B matches a B and so on. Now, we're going to talk about metacharacters, and that's really the alternative. If it's not a literal character, it's a metacharacter--a character that has special meaning. Sometimes they work a little bit like mathematical operators. What they do is they transform literal characters into powerful expressions. There are only a few metacharacters to learn. We're going to be working with these throughout the rest of the tutorial. Basically everything else that you need to know about regular expressions besides literal characters is how do these metacharacters all work, what do they do? And it's complicated, only slightly, because they can have more than one meaning.
It's really dependent on how we use the symbol in context, so we'll be taking a look at that. It's also these metacharacters that have variation between the different regex engines. Now as far as metacharacters go, one thing I want to point out to is that unlike where we just had C-A-R, if we have a metacharacter in there, it also highlights that for us in regexPal. So that's very helpful. It helps us to really see, ah! Here is a bracketed expression, here's the one in parentheses, this is a metacharacter, and it really differentiates them from the literal characters, which don't get colored at all.
That's actually an option here. You can turn off highlighting regex syntax if you don't want it, but I find this pretty helpful, so I usually leave that option on here for Highlight regex syntax. Now one thing I want to notice that I have found when I'm working with regexPal getting ready for this course that sometimes when you paste code into the window, the highlighting isn't quite right right away. And if that happens to you and for some reason the highlighting is not right, all you need to do is hit a space and then erase it again, and it will sort it out. That's all it takes just to make sure that it recovers from that paste.
Let's just put in a new keystroke and take it away again and then the highlighting should come back to the way it ought to be. All right! Now that we know what metacharacters are. We've seen how the highlighting works. Let's dive into learning our first metacharacter, probably the most important one, the wildcard metacharacter.
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.