Cheat sheet regexp
Comment
Assertions
?=
?!
?
^
$
(
)
<
.
*
+
?
Items marked + should work in most
Note regular expression implementations.
Note Ranges are inclusive.
These patterns areintended for reference purposes and have not been extensively tested.
Note Please use with caution and test thoroughly before use.
Control character
White space
Not white space
Digit
Not digitWord
Not word
Hexadecimal character hh
Octal character xxx
Character Classes
\c
\s
\S
\d
\D
\w
\W
\xhh
\Oxxx
Upper case letters
Lower case letters
All letters
Digits and letters
DigitsHexadecimal digits
Punctuation
Space and tab
Blank characters
Control characters
Printed characters
Printed characters and
spaces
Digits, letters and
underscore
POSIX Character Classes[:upper:]
[:lower:]
[:alpha:]
[:alnum:]
[:digit:]
[:xdigit:]
[:punct:]
[:blank:]
[:space:]
[:cntrl:]
[:graph:]
[:print:]
[:word:]
Start of line +
Start of string +
End of line +
End ofstring +
Word boundary +
Not word boundary +
Start of word
End of word\c
\s
\S
\d
\D
\w
\W
\xhh
\Oxxx
Upper case letters
Lower case letters
All letters
Digits and letters
DigitsHexadecimal digits
Punctuation
Space and tab
Blank characters
Control characters
Printed characters
Printed characters and
spaces
Digits, letters and
underscore
POSIX Character Classes
[:upper:][:lower:]
[:alpha:]
[:alnum:]
[:digit:]
[:xdigit:]
[:punct:]
[:blank:]
[:space:]
[:cntrl:]
[:graph:]
[:print:]
[:word:]
Start of line +
Start of string +
End of line +
End of string +Word boundary +
Not word boundary +
Start of word
End of word\c
\s
\S
\d
\D
\w
\W
\xhh
\Oxxx
Upper case letters
Lower case letters
All letters
Digits and letters
Digits
Hexadecimaldigits
Punctuation
Space and tab
Blank characters
Control characters
Printed characters
Printed characters and
spaces
Digits, letters and
underscore
POSIX Character Classes
[:upper:]...
Regístrate para leer el documento completo.