regular expression

(regexp, RE) One of the wildcard patterns used by Unix utilities such as grep, sed and awk and editors such as vi and Emacs. These use conventions similar to but more elaborate than those described under glob.

An ordinary character (not one of the special characters discussed below) matches that character.

A backslash (\) followed by any special character matches the special character itself. The special characters are:

"." matches any character except NEWLINE; "RE*" matches zero or more occurrences of RE. If there is any choice, the longest leftmost matching string is chosen.

"^" at the beginning of an RE matches the start of a line and "$" at the end of an RE matches the end of a line.

[string] matches any one character in that string. If the first character of the string is a "^" it matches any character except NEWLINE and the remaining characters in the string. "-" may be used to indicate a range of consecutive ASCII characters.

\( RE \) matches whatever RE matches and \n, where n is a digit, matches whatever was matched by the RE between the nth \( and its corresponding \) earlier in the same RE.

The concatenation of REs is a RE that matches the concatenation of the strings matched by each RE.

\< matches the beginning of a word and \> matches the end of a word.

RE\m\ matches m occurences of RE. RE\m,\ matches m or more occurences of RE. RE\m,n\ matches between m and n occurences.