I've been trying to make a specific multi-line trigger, reading all the docs and forum posts I can find. The trouble I'm having is with the "lines to match" bit.
The problem, simply put, is that there are any possibility of number of lines matching, from 0-50. If I set the number of lines high, then it matches past incidents as well. If I set it too low, I miss stuff.
Consider the following output:
Spells you can cast:
spell1 spell2
spell3_long_name
spell4 spell5 and spell6
Spells you can't cast:
"firey death" and "eroticism"
Mana left: 500/1000000000
Now, in this output, there are 3 (well, 2) easily definable start and end points. The middle bit (spells you cant cast) might not show up if there's nothing in it. What I want to do is a trigger that matches on the "spells you can cast" line, and then keeps reading the trigger until it hits the last line.
I realise I can probably do this easier by using simple triggers to turn it on and off, but it's actually easier for me if all the data in between gets sent to a script as one big hunk of text. I don't want to have to screw around with concatenating them myself and making sure the newlines are in the right place.
It would be nice if I could have a regexp "^Spells you can cast\n(.*)\nMana left" that would correctly match the multiple lines, and chuck everything in between into %1.
The problem, simply put, is that there are any possibility of number of lines matching, from 0-50. If I set the number of lines high, then it matches past incidents as well. If I set it too low, I miss stuff.
Consider the following output:
Spells you can cast:
spell1 spell2
spell3_long_name
spell4 spell5 and spell6
Spells you can't cast:
"firey death" and "eroticism"
Mana left: 500/1000000000
Now, in this output, there are 3 (well, 2) easily definable start and end points. The middle bit (spells you cant cast) might not show up if there's nothing in it. What I want to do is a trigger that matches on the "spells you can cast" line, and then keeps reading the trigger until it hits the last line.
I realise I can probably do this easier by using simple triggers to turn it on and off, but it's actually easier for me if all the data in between gets sent to a script as one big hunk of text. I don't want to have to screw around with concatenating them myself and making sure the newlines are in the right place.
It would be nice if I could have a regexp "^Spells you can cast\n(.*)\nMana left" that would correctly match the multiple lines, and chuck everything in between into %1.