Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: You won't believe what this regular expression does!

by LanX (Sage)
on Feb 25, 2021 at 15:09 UTC ( #11128785=note: print w/replies, xml ) Need Help??


in reply to You won't believe what this regular expression does!

Didn't you rather want to use + instead of * ?
DB<48> p "hello\nfoo" =~ s/o*$/O/gmr; hellOO fOO DB<49> p "hello\nfoo" =~ s/o+$/O/gmr; hellO fO DB<50>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2022-12-05 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?