|
| BASIC METACHARACTERS
|
| SPECIFIC CHARACTERS (cont)
|
|
| .
| Match any single character
|
| \S
| Match anything but white space character
|
|
| |
| Or
|
| \t
| Tab
|
|
| []
| Match one of a set of characters
|
| \v
| Vertical tab
|
|
| [^]
| Negate a set of characters
|
| \w
| Match any alphanumeric character, digit or underscore
|
|
| -
| Define a range of characters eg. [0-9]
|
| \W
| Opposite of \w
|
|
|
| Escape the next character
|
| \x
| Match a hexadecimal number
|
|
| QUANTIFIERS
|
| \0
| Match octal number
|
|
| *
| Match zero or more of the previous character
|
| BACKREFERENCES & LOOKAROUND
|
|
| *?
| Lazy version of *
|
| ()
| Define subexpression
|
|
| +
| Match one or more of the previous character
|
| \n
| Match nth subexpression
|
|
| +?
| Lazy version of +
|
| ?=
| Lookahead
|
|
| ?
| Match zero or one of the previous character
|
| ?!
| Negative lookahead
|
|
| {n}
| Match exact number of instances
|
| CASE CONVERSION
|
|
| {m,n}
| Match a range of instances
|
| \E
| Terminate \L or \U
|
|
| {n,}
| Match n or more instances
|
| \l
| Convert next character to lowercase
|
|
| {n,}?
| Lazy version on {n,}
|
| \L
| Convert all characters up to \E to lowercase
|
|
| ANCHORS
|
| \u
| Convert next character to uppercase
|
|
| ^
| Match start of string
|
| \U
| Convert all characters up to \E to uppercase
|
|
| \A
| Match start of string
|
| MODIFIERS
|
|
| $
| Match end of string
|
| (?m)
| Multiline mode
|
|
| \Z
| Match end of string
|
| POSIX
|
|
| \<
| Match start of word
|
| [:alnum:]
| Any letter or digit
|
|
| \>
| Match end of word
|
| [:alpha:]
| Any letter
|
|
| \b
| Match a word boundary
|
| [:blank:]
| Space or tab
|
|
| \B
| Opposite of \b
|
| [:cntrl:]
| ASCII control
|
|
| SPECIFIC CHARACTERS
|
| [:digit:]
| Any digit
|
|
| [\b]
| Backspace
|
| [:print:]
| Any printable character
|
|
| \c
| Match a control character
|
| [:graph:]
| Same as [:print:] but excludes space
|
|
| \d
| Match any digit
|
| [:lower:]
| Any lower case character
|
|
| \D
| Opposite of \d
|
| [:punct:]
| Any character that is in not [:alnum:] or [:cntrl:]
|
|
| \f
| Form feed
|
| [:space:]
| Any whitespace character including space
|
|
| \n
| Line feed
|
| [:upper:]
| Any uppercase character
|
|
| \r
| Carriage return
|
| [:xdigit:]
| Any hexadecimal digit
|
|
| \s
| Match any white space character
|
|
|
|