On 05/08/00, ""Flynn, Timothy J" <[EMAIL PROTECTED]>" wrote:
>       What is the best way to search for all printable characters.  i.e..
> I want to eliminate any characters such as \n\r etc.

> $somestring =~ s/[^0-9a-zA-Z]//g; 

If the above is what you want, then use
tr:
$somestring =~ tr/0-9a-zA-Z//cd;

> I want to keep the spaces.

You can add it to the above 'keep' list (how about tabs?):
$somestring =~ tr/0-9a-zA-Z\x20\x09//cd;

Or you can figure out exactly what you DON'T want
and use something like (to get rid of newlines and
carriage returns):
$somestring =~ tr/\x0a\x0d//d;

HTH,
Douglas Wilson

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to