develooper Front page | perl.beginners | Postings from February 2009

Re: Help With Filtering Messages

Thread Previous
From:
Chas. Owens
Date:
February 8, 2009 19:55
Subject:
Re: Help With Filtering Messages
Message ID:
58ce48dc0902081953t4b48de32q8f4d391309d73c9f@mail.gmail.com
On Sun, Feb 8, 2009 at 21:32,  <Jimstone77@aol.com> wrote:
> I know there is probably a simple solution for this, but can anyone help me
> with code to filter out messages with extended characters like these:
snip

It might be easier to specify what characters you want to allow rather
than the characters you don't.  Based on what I saw in your list it
looks like you want something like

print $message if $message =~ /[^\x00-\x7f]/;

This will print the string in $message if it contains any character
other than the 7-bit ASCII characters.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About