Hi Marck,

Historians believe that Wednesday, June 25, 2003 at 16:36 GMT +0100
was when, Marck Pearlstone [MP] typed the following:

MDP>>> %setpattregexp='(?i)(.*)\[OK\]\s+(.*)'%-
MDP>>> %RegExpBlindMatch='%OFullSubj'%-
MDP>>> %subject="%SubPatt='1'%SubPatt='3'"
<snip>
MP> It worked in a QT here when I tested it... then again, it's a pretty
MP> stupid algorithm and will lose everything when there's a subject
MP> that omits the [OK] bit.

That can be fixed.  Just put the [OK] part into a subpattern and put
a question mark to make it zero or one instance.

So the simple modification would be something like:
%setpattregexp='(?i)^(.*?)(\[OK\]\s*?)?(.*?)$'%-
%RegExpBlindMatch='%OFullSubj'%-
%subject="%SubPatt='1'%SubPatt='3'"

This *should* work, but the regexp doesn't seem to be working for me
in the current beta.  I haven't yet pinned down if there really is a
bug or if there is some *extreme* ungreedy/greedy/ungreedy subtlety
that I'm missing. 

The only way I could get it to work is by using a conditional regexp,
but that should not be necessary:

%setpattregexp='(?i)^(.*?)(?(?=\[OK\])\[OK\]\s*(.*?)|)$'%-
%RegExpBlindMatch='%OFullSubj'%-
%subject="%SubPatt='1'%SubPatt='2'"


-- 
Thanks for writing
Januk Aggarwal




________________________________________________________

http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to