Recent change in Perl RE matching

Recent change in Perl RE matching

3

    9:43 - 4 days ago#1

    I have been depending for years on the fact that \s did not match the end-of-line with Regular expressions: Perl.
    In the last month or so, it has changed and now an expression like "^\s+function" matches things like "<eol><eol>function".
    Is it a recent change, a new parameter with "inverted" default (not matching the previous behaviour), or...?
    Thanks for any comment.

    19576
    MasterMaster
    19576

      10:13 - 4 days ago#2

      AFAIK \s matches all whitespace characters including eol. Frankly speaking I didn't notice that \s didn't match eol before. I suppose you know the specialized shorthands \h and \v for matching horizontal respective vertical whitespace characters.

      BR, Fleggy

      3

        11:36 - 4 days ago#3

        maybe... ... Thanks for the reply anyway.
        Maybe I was mixed up with ".", which in Perl Regular Expressions can be configured to match or not the "\n" (/s, /m modifiers).

        6,672580
        Grand MasterGrand Master
        6,672580

          19:10 - 4 days ago#4

          \s is short for [[:space:]] which matches any whitespace character according to the Unicode standard as described by Perl Regular Expression Character Classes or by the documentation page Perl Regular Expression Syntax of the Boost C++ library used by UltraEdit for Perl regular expression finds/replaces. I listed the whitespace characters according to Unicode in my forum post Remove / delete blank and empty lines. This is the reason why I use nearly always [\t ] and not \s for matching just normal spaces and horizontal tabs.

          The forum topic "." (dot) in Perl regular expressions doesn't include newline characters CRLF? is about the matching behavior of a dot in a Perl regular search expression.
          Best regards from an UC/UE/UES for Windows user from Austria

          3

            19:18 - 3 days ago#5

            Thanks for the explanations.