7.9. Useful Escape Sequences
Perl has several escape sequences which are specific to regular expressions. Here is a list of some of the more useful ones:
\w- matches a word character, equivalent to[A-Za-z_]. The corresponding sequence -\Wmatches a non-word character.\s- matches a whitespace character, usually space and tab.\Smatches a non-whitespace character.\d- matches a digit. Equivalent to[0-9].\Dmatches a non-digit.\b- matches a word boundary. This sequence in fact has a zero width but it is nevertheless highly useful.\Bmatches something that is not a word boundary.