A regular expression is a special text string for describing or validating a pattern. The pattern can dictate what characters to include, exclude, and ignore as well as the number of characters between the rules of each section of the pattern. Also abbreviated regex.