I'm trying to get a trigger to match on the room name, Exits, and room description in one go.
My MUD outputs the following:
I'm trying to match the room name (Some Room Name), the exit directions ("north south up down"), and the optional room desc (all non-blank lines after exits terminated by an empty line).
The following sort of works in that it captures the room name, the exits, and only the first line of the description. Adding an extra '\n' before the '\z' to try to match an empty line does NOT work, however.
Any ideas? I'm just sort of playing around with different modifiers to this basic setup. I do note that if I add (?s) to it, it grabs everything down to the blank line and then the line right after the blank if there one (usually either the prompt or room contents).
[EDIT] Added code tags.
My MUD outputs the following:
Some Room Name
[Exits: north south up down]
Some optional room desc line.
More optional room desc lines.
[a blank line here]
optional room contents
<Some Prompt>
I'm trying to match the room name (Some Room Name), the exit directions ("north south up down"), and the optional room desc (all non-blank lines after exits terminated by an empty line).
The following sort of works in that it captures the room name, the exits, and only the first line of the description. Adding an extra '\n' before the '\z' to try to match an empty line does NOT work, however.
<triggers>
<trigger
enabled="y"
group="Mapping"
lines_to_match="3"
match="^(.+)\n[Exits: (.+)]\n(.*)\n\z"
multi_line="y"
name="RoomDetector"
regexp="y"
send_to="2"
sequence="100"
>
<send>print (Room Name: %1, Exits: %2, Description: %3)</send>
</trigger>
</triggers>
Any ideas? I'm just sort of playing around with different modifiers to this basic setup. I do note that if I add (?s) to it, it grabs everything down to the blank line and then the line right after the blank if there one (usually either the prompt or room contents).
[EDIT] Added code tags.