in reply to Mnemonic for begin/end chars in regexes

Not exactly a mnemonic, but logical thinking

Perl regexes allow variable interpolation and a final $ is taken as a meta for end-of-line

Hence a $ at the beginning would be very impracticable

edit

Otherwise, what would /$var/ be supposed to match?

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Mnemonic for begin/end chars in regexes
by Smonff (Monk) on May 12, 2023 at 14:13 UTC

    Very interesting, thanks. Unfortunately, you can see I totally miss this kind of logic.

    🌸
      > Unfortunately, you can see I totally miss this kind of logic.

      Interesting, how do you read /$var/?

      Cheers Rolf
      (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
      Wikisyntax for the Monastery