Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by LanX (Saint)
on Feb 25, 2021 at 15:09 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-19 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found