At 12:49 -0500 02.02.2001, Kenneth Graves wrote:
>From: Uri Guttman <[EMAIL PROTECTED]>
>>         s/\D+//g ;
>>
>>         tr/0-9//cd ;
>
>One of those "why did Larry do it that way?" questions:
>Why can't I use:
>
>          tr/\d//cd ;
>
>(I.e., why don't character classes work in tr?  \s and \S would be
>very convenient.)

\d is not a character class, but a metacharacter.  And I guess the answer
to "why not" is that metacharacters are for regexes, and tr/// does not use
regexes.  It only looks like it does.

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to