in reply to Range of chars except one

$text =~ s/[^\x20-\xff\x0a]//g;

Replies are listed 'Best First'.
Re: Re: Range of chars except one
by Juerd (Abbot) on Jan 20, 2002 at 01:06 UTC
    Not all data is ascii. Your piece of code will remove all unicode characters, which may or may not be what you want.

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$