Multiline Trigger Firing on Every Line

Posted by Tvistor on Thu 12 Jul 2018 07:30 AM — 2 posts, 11,274 views.

#0
Hi all,

I am trying to match the map one sees in Achaea when seafaring. A map will generally have 25 columns and 17 rows of tiles, represented with various characters.

In the map I am dealing with, these tiles will only be whitespace, 'm', 'w', '?', '=' and '.'.

My current attempt to match this is the following hideous regular expression:

^[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\n[w\.m ?=]{25}\Z

I then turn on 'Multi-line; match' and set this to 17. However, this seems to fire 17 times, once for every line of the map. My goal is to ultimately capture the entire map as a single string and pass it to a Lua function.

Any help at all would be greatly appreciated.
Amended on Thu 12 Jul 2018 07:31 AM by Tvistor
Australia Forum Administrator #1
Hi! Can you post the actual trigger please?

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


And also post an example of a map? (copy/paste)

Then we can reproduce the problem and advise you.

Personally I try to avoid multi-line triggers because they can behave in unexpected ways.

Template:faq=37
Please read the MUSHclient FAQ - point 37.