dijous, 25 de setembre del 2008

Tipus de caràcters a Regular Expression

POSIX Perl ASCII Description
[:alnum:]
[A-Za-z0-9] Alphanumeric characters
[:word:] \w [A-Za-z0-9_] Alphanumeric characters plus "_"

\W [^\w] non-word character
[:alpha:]
[A-Za-z] Alphabetic characters
[:blank:]
[ \t] Space and tab
[:cntrl:]
[\x00-\x1F\x7F] Control characters
[:digit:] \d [0-9] Digits

\D [^\d] non-digit
[:graph:]
[\x21-\x7E] Visible characters
[:lower:]
[a-z] Lowercase letters
[:print:]
[\x20-\x7E] Visible characters and spaces
[:punct:]
[-!"#$%&'()*+,./:;<=>?@[\\\]_`{|}~] Punctuation characters
[:space:] \s [ \t\r\n\v\f] Whitespace characters

\S [^\s] non-whitespace character
[:upper:]
[A-Z] Uppercase letters
[:xdigit:]
[A-Fa-f0-9] Hexadecimal digits