Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: \s matches newline in regex?

by kroach (Pilgrim)
on Jul 22, 2015 at 17:41 UTC ( [id://1135886]=note: print w/replies, xml ) Need Help??


in reply to \s matches newline in regex?

You can use non-greedy matching and $ to match whitespace up until a newline.
$line =~ s/Hi\s*?$//m;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found