greatshots has asked for the wisdom of the Perl Monks concerning the following question:

respected monks,

($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss') =~ y~b-v~a-z~s; p +rint
the above can also be written as
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss') =~ y/b-v/a-z/s; p +rint
when can I find the explanation about y and s used in that regex ? I have no idea about that ?

Replies are listed 'Best First'.
Re: Interesting regular Expression
by fenLisesi (Priest) on May 03, 2007 at 09:23 UTC
    perlop. Search the page for "Transliterates". Cheers.
      Thanks for your prompt reply. Mistakingly, I was searching in perlre
        perlre won't help here because y/// is no regular expression. It only deals with characters, and it doesn't support "*", ".", or any of the other regex things.

        easy mistake to make. Perl's documentation is mostly good, but I keep finding I have to look up perlop, perlrequick, perlre and perlretut to get the whole picture for regular expressions and transliterations. Sometimes I think might be nice to have a more distinct syntax for s/// and y/// (or tr///). Although having regex substitutions and transliterations in the same section in the docs kind of makes sense because they do similar things.

        How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
        Robot Tourist, by Ten Benson