In computer programming, a character class is a set of characters that share common properties. Character classes are used to define patterns for searching and manipulating text in regular expressions. A regular expression is a sequence of characters that defines a search pattern for finding occurrences of that pattern within a given string or document. Regular expressions use various metacharacters, such as * (matches any number of characters), + (matches one or more characters) and ? (matches zero or one character). Character classes are defined using parentheses and specify a set of characters that can be matched by the corresponding metacharacter. For example, [abc] defines a character class that matches any of the letters 'a', 'b' or 'c'.