There are a number of useful non-printing characters that must be used occasionally.
Escape Sequences that Represent Non-printing Characters
Character | Meaning |
---|---|
\cx |
Matches the control character indicated by x. For example, \cM matches a Control-M or carriage return character. The value of x must be in the range of A-Z or a-z. If not, c is assumed to be a literal 'c' character. |
\f |
Matches a form-feed character. Equivalent to \x0c and \cL. |
\n |
Matches a newline character. Equivalent to \x0a and \cJ. |
\r |
Matches a carriage return character. Equivalent to \x0d and \cM. |
\s |
Matches any white space character including space, tab, form-feed, and so on. Equivalent to [\f\n\r\t\v]. |
\S |
Matches any non-white space character. Equivalent to [^ \f\n\r\t\v]. |
\t |
Matches a tab character. Equivalent to \x09 and \cI. |
\v |
Matches a vertical tab character. Equivalent to \x0b and \cK. |