Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Regex bug? matching multiple newline with /m

by BillKSmith (Monsignor)
on Aug 14, 2021 at 15:23 UTC ( [id://11135844]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regex bug? matching multiple newline with /m
in thread Regex bug? matching multiple newline with /m

The problem with interpolation is covered in the documentation for  /PATTERN/msixpodualngc in Regexp Quote Like Operators.
If "'" is used as the delimiter, no variable interpolation is done.

This is not enough to solve your problem with the newline because $ is a zero width assertion. Assertions

Besides "^" and "$", Perl defines the following zero-width assertions:

In this case, it is probably best to match the newline explicitly and not use the anchor at all.

Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135844]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-24 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found