Hi,

#!/perl/bin/perl -w
use strict;
#map & join from @ARGV into $pattern snipped
my $pattern='(?=.*doc)(?=.*sort)';
#print "$pattern";
#directory files foreach file to be searched snipped
if (s/^H=($pattern)/$1/io) {
     print "$fil:$_" ;
     }
#end

The above with the rest of my script finds doc, document, dock, sort, sorted, sorting

But what I want it to find is: doc, sort

In the map and join line I tried \b

(?=.*\bdoc\b)

but the pattern got messed up, part of the pattern got cut off.

How to make it so it find what I want it to find?

Otherwise, what I'm up to here is: I want a method to broaden or narrow my keyword search according to number of keywords entered. The keywords can be in any order on the line in the searched file (searches one line at a time) and don't have to match the order in which they were entered on the commandline.

--
Alan.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to