James G. Sack (jim) wrote:
> Ralph Shumaker wrote:
>>>> 3. If a quick & dirty solution might be acceptable, just run a chain of
>>>> 4 searches.
>> ..
>> Wait a minute.  It occurs to me that you may know something I don't. 
>> Are you saying that there is a way to do a  four part compound search in
>> vim?
> 
> Nah, sorry. I was just alluding to the same thing suggested by jhriv and
> kc, namely something like
> 
> grep ada sample.txt | grep bub | grep crc | grep dod

I had a post-thought:

The chain-approach (multiple passes, as in the grep line above) has a
potential problem if your search strings contain common substrings that
match when abutted.

for instance, if I change your object strings to
  ada bub crc dad

then the grep approach will give a false positive on
 adad bub crc

Of course you may have intended to call that a hit (if so your problem
specification could have been improved), in which case the list of
permutations search approach will fail to match.

Fun!

Regards,
..jim


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to