PHP Regular Expressions – Part II Introduction In this part of the series, we start analyzing patterns in PHP Regular Expressions. Character Classes The Square Brackets A character class allows a set of possible characters, where one of them would match at a particular point, a character, in the subject string. Character classes are denoted by brackets [...], with the set (class) of characters to be possibly matched inside. Here are some examples: Let your subject string be “He has a cat.” You... Sign in to see full entry.