in reply to Re^3: Making $ Unicode-aware
in thread Making $ Unicode-aware

\v is not the vertical tab. It matches the character class of "vertical whitespace". The characters belonging to this class are listed in perlrecharclass as:

LINE FEED LINE TABULATION FORM FEED CARRIAGE RETURN NEXT LINE LINE SEPARATOR PARAGRAPH SEPARATOR
So actually \R matches all single vertical space characters and the two character sequence CR LF. This includes all common line endings.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re^5: Making $ Unicode-aware
by jcb (Parson) on Jul 28, 2020 at 23:40 UTC

    So \v is a regex class instead of a character escape. That makes sense, then.

    What existing code could changing $ to use \R instead of \n potentially break? Could this raise security issues by widening input validation patterns?

      What existing code could changing $ to use \R instead of \n potentially break? Could this raise security issues by widening input validation patterns?

      A bit difficult to say, as even \n is not just a LF but a "logical newline", as described in perlrebackslash:

      \n matches a logical newline. Perl converts between \n and your OS's native newline character when reading from or writing to text files.
      And because it is so hard to tell I wouldn't want to change the meaning of $ without explicit request to do so for a single regex or within a lexical scope, i.e. by a flag or pragma.

      Greetings,
      -jo

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$