in reply to I need a Regex to get my Dirty Data Whiter.

Given that most printable characters appear in consecutive runs in most popular character sets, it's easy to build a character class which only includes them. for example, for 7-bit ASCII you can write something like this to only print character between the space (0x20) and the tilde (0x7E).

while (<>) { s/[^ -~]//g; print; }
--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>

Replies are listed 'Best First'.
RE: Re: I need a Regex to get my Dirty Data Whiter.
by merlyn (Sage) on Aug 03, 2000 at 16:54 UTC