a regular expression (abbreviated regexp or regex) is a way to describe sets of characters using syntactic rules. many programming languages use or support regular expressions. a regular expression is then used by a special program or part of a programming language. this program will either generate a parser that can be used to match expressions or it will match such expressions itself.