>>>>> "RJK" == Ronald J Kimball <[EMAIL PROTECTED]> writes:
RJK> On Fri, Feb 02, 2001 at 02:29:26PM -0500, Kenneth Graves wrote:
>> \n is a metacharacter, and does work in tr. The metacharacters that
>> encode single characters work in tr like they do in an interpolated
>> strings. The metacharacters that match multiple characters in a regex
>> don't work in tr. The problem is, my brain keeps insisting that
>> tr/thesechars//d;
>> is "really" an optimized version of
>> s/[thesechars]//g; # or [theschar]
>> and I keep trying to do
>> tr/\s//d; # doesn't eliminate whitespace
RJK> Consider, however, the confusion that would result from:
RJK> tr/\s/\S/;
not only that but a char class makes sense in tr only with no
replacement chars and the /c, /d and /s options. the order of chars in a
char class is not defined so how could you supply a order list of
replacement chars?
but having char classes for stuff like:
tr/\d//cd ;
to strip non-digits is a cool idea. may be in perl6 but i can't find an
rfc that covers this.
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com