in reply to (jeffa) Re: Pattern Matching
in thread Pattern Matching

In the line

$report =~ tr/-_.//d; # underscores, dashes, and periods

won't the . match any character and filter it out? Don't you need to escape it, or does it work differently with the tr as opposed to s?

There is no emoticon for what I'm feeling now.

Replies are listed 'Best First'.
Re: Re: (jeffa) Re: Pattern Matching
by fruiture (Curate) on Dec 16, 2002 at 17:11 UTC

    No, tr/// is not s/// or m//, but it's y/// :-)

    The transliteration operator does not have anything to do with regular expressions, that's why the . doesn't have special meaning in it. See perlop.

    --
    http://fruiture.de
      Thanks for the clarification!

      There is no emoticon for what I'm feeling now.

(jeffa) 3Re: Pattern Matching
by jeffa (Bishop) on Dec 16, 2002 at 17:11 UTC