[pmwiki-users] TextExtract (Search recipe) update

Hans design5 at softflow.co.uk
Tue Sep 1 08:51:53 CDT 2009


Tuesday, September 1, 2009, 1:20:22 PM, The Editor wrote:

> Nice recipe Hans!  You have thought of many nice new features. Kudos

Thanks, Dan!

One thing I would love to add sometime, but don't know how yet,
because it is complex, is:
How to do a proper AND search:
return lines or paras with both 'abc' AND 'xyz' terms, but not any
with only one of them.

At present entering 'abc xyz' is the same as entering '"abc" "xyz"',
and only the complete string will be matched.
I could enter 'abc.*xyz' but that does not match 'xyz.*abc'
I could enter '(abc.*xyz)|(xyz.*abc)', which will get both abc and
xyz together. But you see how complicated the input gets, and the
highlighting will fail.

The thing to do would be recursive preg_matching on individual search
patterns like first find 'abc', then check for 'xyz', etc.
The highlighting will be still a nightmare to program.


  ~Hans




More information about the pmwiki-users mailing list