Braces allow the matching of a specific set of characters. Note that the braces search for a single character. The number of characters within the braces indicates what the valid characters to search for are, but, again, single characters are checked. The hyphen character can be used to denote a range of characters. For example, 4.uys would match strings like 4Guys , 45uys , and 4zuys .
Character classes are really useful for matching complex patterns.
For example, imagine that we wanted to determine if a phone number was valid or not. These characters search for a literal left and right parenthesis, respectively. There are several special symbols that can be used to search for repeating substrings or patterns. Repition matching is another powerful facet of regular expressions. For example, in an earlier example we demonstrated how to match a phone number.