Archive for March 12th, 2008
Ruby / Regular Expression
\w Matches word character, as in [0-9A-Za-z_]
\W Matches nonword character
\s Matches whitespace character, as in [\t\n\r\f]
\S Matches nonwhitespace character
\d Matches digit, same as [0-9]
\D Matches nondigit
\A Matches beginning of a string
\Z Matches end of a string, or before newline at the end
\z Matches end of a string
\b Matches word boundary outside [], or backspace (0×08) [...]