http://www.perlmonks.org?node_id=1029816


in reply to Regex expression is matching more than once

tr replaces characters, while s/// replaces substrings.

Your code in fact removes all characters in the set lmx.()$ from the target string.

Update: Athanasius pointed out that I missed the dollar sign in what tr replaces. The expression given to tr// does not interpolate variables.

Replies are listed 'Best First'.
Re^2: Regex expression is matching more than once
by tobias_hofer (Friar) on Apr 22, 2013 at 08:02 UTC

    Oh.. Thanks a lot!
    Next time I will read the perl doc more carefully!
    Promised! ;-)
    Cheers!
    Tobias