From the course: Learning Regular Expressions
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Metacharacters inside characters sets - Regular Expressions Tutorial
From the course: Learning Regular Expressions
Metacharacters inside characters sets
- [Instructor] Let's take a look at how we can use meta characters inside character sets. Most meta characters inside of character sets are going to already be escaped. That is, they're going to have their literal meaning. They're not going to be considered meta characters, so you do not need to escape them again. For example, if we had a regular expression that had H and then a character set followed by T, and in that character set we had the letter A and the dot, that dot is a literal period. It's not a meta character representing a wild card so it would match the words hat and H dot T but it would not match the word hot. And if you think about it, it makes sense. You wouldn't put a wild card character inside a character set. A wild card matches everything. The point of a character set is to match a smaller set than everything. Now, there are some exceptions to this rule. Notably the closing square bracket, the dash,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.