Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Pattern matching regex problem

by ikegami (Patriarch)
on Nov 23, 2021 at 21:00 UTC ( [id://11139063]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Pattern matching regex problem
in thread Pattern matching regex problem

tr/M// is sufficient.

Replies are listed 'Best First'.
Re^5: Pattern matching regex problem (Abigail's Length Horror)
by eyepopslikeamosquito (Archbishop) on Nov 24, 2021 at 10:45 UTC

    tr/M// is sufficient

    Indeed it is ... as any golfer would know. :) Speaking of which, note that y is an oddball synonym for tr -- added, not for golfers (because code golf didn't exist back then), but to entice diehard sed devotees to the new frontier of Perl.

    I have to give a further honourable mention to y///c -- aka Abigail's length horror -- because it's one character shorter than the prosaic length.

    Finally, note that Perl's flexibility of being able to choose your own delimiter has made tr a favourite of obfuscators (and bored golfers) ... as I remember from this amusing expression:

    ($.|y|||c|y|a|||y|e|||y|i|||y|o|||y|u|||y|y||)||print
    employed in a (non-winning) entry in the pioneering Get Even golf game of 2002.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-16 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found