"A regular expression (abbreviated as regexp, regex or by some regxp) is a string that describes a whole set of strings, according to certain syntax rules. These expressions are used by many text editors and utilities (especially in the Unix operating system) to search bodies of text for certain patterns and, for example, replace the found strings with a certain other string."
Sun's Regex Package is explained in detail in a chapter from the Jeffrey E. F. Friedl's book :