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

Re: Help With Filtering Messages

Thread Previous
Chas. Owens
February 8, 2009 19:55
Re: Help With Filtering Messages
Message ID:
On Sun, Feb 8, 2009 at 21:32,  <> 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:

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
The most important skill a programmer can have is the ability to read.

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About