Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: How to make this substitutions without splitting the strings? (tr/// behavior)

by farang (Chaplain)
on Aug 01, 2014 at 05:22 UTC ( #1095845=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to make this substitutions without splitting the strings? (tr/// behavior)
in thread How to make this substitutions without splitting the strings?

Do you know of any documentation of this "leftmost match" feature in the tr/// built-in?
From perlop:

"If multiple transliterations are given for a character, only the first one is used:

tr/AAA/XYZ/

will transliterate any A to X."

  • Comment on Re^3: How to make this substitutions without splitting the strings? (tr/// behavior)
  • Download Code

Replies are listed 'Best First'.
Re^4: How to make this substitutions without splitting the strings? (tr/// behavior)
by AnomalousMonk (Archbishop) on Aug 01, 2014 at 05:34 UTC

    Ah, the undocumented, documented! That feels better! I looked for just this sort of assertion (a couple of times) and couldn't find it. Thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-02-08 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?