Negated character classes

By placing the carrot character (^) in the first position inside a character class (just next to [) negates the matching of the character class. A negated character class matches any character that is not included in the class. A negated character class also negates a character range by matching any character not matched by the character range.

You learned in Chapter 1, Getting Started with Regular Expressions, that dot (.) matches any character except the newline character. However, note that the negated character class also matches newline characters such as , , and so on.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.239.48