Hi - > -----Original Message----- > From: Philipp Gruemmer [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 2:25 AM > To: [EMAIL PROTECTED] > Cc: Gary Stainburn > Subject: Re: Blacklist an array > > > Hello Gary, > > > [gary@gary gary]$ cat t > > #!/usr/bin/perl -w > > > > my @input=('one','two','three'); > > my @blacklist=('two','four'); > > > > foreach $line (@input) { > > foreach $cond (@blacklist) { > > print "$line=$cond..."; > > if ($line=~/$cond/) { > > print "true\n"; > > last; > > } > > print "false\n"; > > } > > } > > [gary@gary gary]$ > > This comes very close. But it doesn't seem to find *any* occurence of the > searched string. Only those that stand 'alone'. How do I match these > (assuming the string to find ist 'test')? > > ldjtestödsfllöf > ^^^^ > test > jsdfkjsh test sldflösdfk > lödskföldtest > ^^^^ > testösldfkdlfk > > which actually means *any* line containing the string 'test'... > > I tried /.+test.+/ so far, but it doesn't seem to work here... >
Just /test/ . That _must_ work! It _better_ work or I am giving up on perl :) Aloha => Beau. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]