Multi-line trigger woes

Posted by Heliomance on Thu 06 Sep 2007 04:57 PM — 2 posts, 11,801 views.

#0
I want a trigger that will match on a certain line. Unfortunately, this line could be absolutely anything, there is no way to predict what form it will take. Fortunately, it is always immediately preceded and followed by ------------------------------------
I want a trigger which will look for the two ----------------------------- then send the middle line - the random one - to the script for parsing. After much trial and error, I have a trigger which looks like this:
^---------------------------------------------------------------------------$\n^ ((.)+)(?U)$\n^---------------------------------------------------------------------------$

which works, and sends the line to wildcards[0]. The trouble is, I haven't got the faintest idea why it works, especially as it doesn't work if you take the (?U) out. Can someone help me make a more sensible trigger, and explain to me how it works please?
Australia Forum Administrator #1
You can shorten it by using a "count" like this:


^-{75}$\n^ ((.)+)(?U)$\n^-{75}$


The (?U) sets the "ungreedy" option, which makes it match on the minimum it can rather than the maximum.