I'm trying to use a single trigger to match and send a string pattern. Perhaps it should be setup as a multi-line trigger.
Here is the MUD output I'm trying to match:
I want to pull 5 different strings out of that text:
This is the regex I'm using:
This regex seems to work exactly as I intend. I feel quite sure that I've implemented the trigger logic improperly.
The actual trigger:
The current behavior causes this trigger to fire once per each line that contains the direction descriptions, and only captures the first matching sequence. I'd like to capture all matching sequences on a given line. The regex works as intended when checking it with regexpal.
Here is the MUD output I'm trying to match:
Inn of the Dripping Dagger
N-Battered and gouged wooden door S-Selduth Street W-Inn of the Drip U-Secon Floor of
D-The Cellar of t
This cozy old inn is well known as a favorite watering hole and resting
place for hire-swords and it has a reputation for jovial horseplay that
keeps more timid visitors away. It is a low-ceilinged taproom with two sets ofI want to pull 5 different strings out of that text:
- N-Battered and gouged wooden door
- S-Selduth Street
- W-Inn of the Drip
- U-Secon Floor of
- D-The Cellar of t
This is the regex I'm using:
\b(?:(?:[NSWUD]|[NS][EW])-)(?:(?:[\w ](?!(?:[NSWUD]|[NS][EW])-))+)\bThis regex seems to work exactly as I intend. I feel quite sure that I've implemented the trigger logic improperly.
The actual trigger:
<trigger
name="ExitTrigger"
enabled="y"
regexp="y"
multi_line="n"
keep_evaluating="y"
match="\b(?:(?:[NSWUD]|[NS][EW])-)(?:(?:[\w ](?!(?:[NSWUD]|[NS][EW])-))+)\b"
send_to="12"
sequence="100">
<send>ListExit "%0"</send>
</trigger>The current behavior causes this trigger to fire once per each line that contains the direction descriptions, and only captures the first matching sequence. I'd like to capture all matching sequences on a given line. The regex works as intended when checking it with regexpal.