Actually, Nick, you are wrong. The expression
does work as I said. I tested it with this:
<triggers>
<trigger
enabled="y"
match="^You say\: The (?!Orc)(.*?) is green\.$"
name="Test"
regexp="y"
script="TriggerTest"
sequence="100"
>
</trigger>
</triggers>
Sub TriggerTest (N, L, W)
World.Note "1: '" & W(1) & "'"
World.Note "2: '" & W(2) & "'"
World.Note "3: '" & W(3) & "'"
End Sub
Perhaps the reason this works is because the expression is evaluated left to right, and once it encounters a mismatch, it rejects the line immediately without processing the rest. (Actually more efficient).
Indeed, I can understand why you made the statement you did, and I suppose this effect could possibly be considered a bug, if what you wanted is the results that you predicted.
Nah... not a bug. If one wanted the type of results you predicted, they would use ?: instead of ?! like below:
^You say\: The (?:Orc)(.*?) is green\.$
Which with a line like "You say: The Orchard is green." would return "hard" as wildcard 1.
Heh, actually, that's not what you predicted either. Building an expression to do what you expected would be pretty hard. I would only consider the above a bug if what you expected could not be done another way... because then you have a situation which can't be resolved.
I've spent enough time on this for now. Sorry, I'm not in the mood to
try and build a trigger to do what you expected mine to do... Perhaps another time. :)