An Introduction to Regular Expressions The Basics 12 of 50 : [PREV] [NEXT]

Standard Meta Characters

Escape Characters

A backslashed character matches a special character or a character class (more than one character). Here's a list of special characters:

\n Linefeed
\r Carriage return
\t Tab
\v Vertical tab
\f Form-feed
\d A digit (same as [0-9])
\D A non-digit (same as [^0-9])
\w A word (alphanumeric) character (same as [a-zA-Z_0-9])
\W A non-word character (same as [^a-zA-Z_0-9])
\s A whitespace character (same as [ \t\v\n\r\f])
\S A non-whitespace character (same as [^ \t\v\n\r\f])

\###, where ### is a backslashed two- or three-digit octal number such as \033, matches the character with the specified value, unless it can be interpreted as a backreference. Priority is given to backreferences in this case.


© 2003 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/