http://www.perlmonks.org?node_id=854606


in reply to Re^4: Reading Reg Exp
in thread Reading Reg Exp

According to the perlrecharclass manpage:

\s matches any single character that is considered whitespace. In the ASCII range, \s matches the horizontal tab (\t), the new line (\n), the form feed (\f), the carriage return (\r), and the space.

It also says:

Without a locale or EBCDIC code page, \s matches the five characters mentioned in the beginning of this paragraph.

Update: Link fixed.

Replies are listed 'Best First'.
Re^6: Reading Reg Exp
by JavaFan (Canon) on Aug 12, 2010 at 08:42 UTC
    Both cases are talking about matching ASCII characters. The first mentioning ASCII, the second when it's discussing non-UTF8 matching.

    But the explain of the regex cannot know whether UTF-8 matching is in effect or not, as that will depend on the encoding of the subject string.

      But the explain of the regex cannot know whether UTF-8 matching is in effect or not, as that will depend on the encoding of the subject string

      Good point. Especially if you pass a pre-compiled regex instead of a string. I think for what the module is trying to do, the simplest usages would suffice for most cases.