Hello,

I attempting to setup a filtering scheme to check various words in a message string , going through each word in the string, word by word, and check them against a list of non-allowed words/characters in a string, see(below) to see if each of the words contain one of these below, but can't seem to get a handle on the correct regexp to use to check each word against the each one in the list below.
.com
.net
.org
.biz
.ws
.co.uk
.ca
.nz
.au
dot
{dot}
[dot]
(dot)
-dot _dot
@
(at)
{at}
[at]
www
http
icq
aol
hotmail
yahoo
gmail
msn
www.


I take the message string: @messagewords = split'',$messagestring;
then loop thru each @messagewords and see if they contain one of the stop words below, if they do, the message content isn't allowed. This is just a test code we be working with, but it doesn't seem to work. Regexp has never been my strong point.

  open(LG,"<$conf{languagedir}message_filter.lang") or die $!;
  flock(LG, 2);
  my @filters = <LG>;
   close(LG);

 for my $word (@messagewords)
  {
   CHECK:
   for (my $i=0; $i<@filters; $i++)
    {
     chomp $filters[$i];
     next CHECK if length($word)<2;
if($wordtochk eq $filters[$i] or $wordtochk =~ /(\d\s*){6,11}/ or $wordtochk =~ /\@/)
       {
         print qq~Word: $wordtochk - Filter:$filters[$i]<br>~;
        $match = 1; last CHECK;
       }
    }
  }

 Any help would be much appreciated. :)

--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to