From the course: Learning Regular Expressions
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Negative character sets - Regular Expressions Tutorial
From the course: Learning Regular Expressions
Negative character sets
- [Narrator Now that we know about character sets, we're ready to learn about negative character sets. We create a negative character set using the negative meta character, which is a carrot symbol or upward pointing arrow. Depending on your keyboard layout, it may be over the six key. It's going to negate a character set. What it means is that the character set, is not any one of several characters. That's the opposite of a character set. A character set normally is saying that the pattern matches any one of several characters. Now we're saying it's not one of the several characters. It's a list of characters that can't be there. To do that you add that negative metacharacter as the first character inside the character set. It has the effect of making the entire character set into a negative set. So if we had square brackets with the negative character at the beginning, as the first character, followed by a, e, i, o, u,…
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.