in reply to Re: Using /m when $ is followed by punctuation
in thread Using /m when $ is followed by punctuation

Thanks, I see that now. Do you know of an answer to the general question: how to get perl to parse $ followed by by an escape sequence as $ \whatever rather than $\ whatever?

Replies are listed 'Best First'.
Re^3: Using /m when $ is followed by punctuation
by ikegami (Patriarch) on Aug 05, 2014 at 22:48 UTC

    I don't think you'd ever need to do that, but I can think of a couple of solutions:

    • (?x: $ )
    • (?=\n|\z) (if /m is in effect)
    • (?=\n?\z) (if /m isn't in effect)
    • (?![^\n]) (if /m isn't in effect)
      Thanks, ikegami. I had remembered that there seemed to be no need for an interior $ followed by an escape, but I failed to think outside the box I had constructed for myself in the original question.