5 ms·
Raku (formerly Perl 6) has picked ^ and $ for start-of-string and end-of-string, and has introduced ^^ and $$ for start-of-line and end-of-line. No multi line m
by perlgeek 3y ago
Raku (formerly Perl 6) has picked ^ and $ for start-of-string and end-of-string, and has introduced ^^ and $$ for start-of-line and end-of-line. No multi line mode is available or necessary.
(There's also \h for horizontal and \v for vertical whitespace)
That's one of the benefits of a complete rethink/rewrite, you can learn from the fact that the old behavior surprised people.
- Terretta 3y agoAnd this is why this curmudgeon can't use Perl 6[^1]. It randomly shuffles the line noise we learned over decades. It seems so obvious that's the opposite of what they should have defaulted to, that it clearly should have been ^ and $ for lines, and ^^ and $$ for the string, since like ((1)(2)(3)): ^^line1$\n^line2$\n^line3$\n$ [1]: That, and it's not anywhere, while Perl 5 is everywhere.
- richardwhiuk 3y agoThink I would have picked exactly the reverse (i.e. ^^ being more "starty" than "^").
- lcnPylGDnU4H9OF 3y agoReminds me of verbosity flags in some cli utilities. Often, -v is "verbose" and -vv is "very verbose" and -vvv... etc.
- librasteve 3y agoPretty much all the regexen I have written have been predicated on start / end of string (i typically feed lines through the regex) … so picking single ^ and $ for the whole string maintains a degree of backward compatibility (assuming that I am normal)