I'm trying to create a trigger for a plugin that captures the list of enemies for my current city and adds them to an array. cityenemies.cyrene = {}, in this case.
Here is a shortened example of what I see when I do CITY ENEMIES in Achaea.
Currently I'm testing using a world trigger with this regex pattern:
And it works, surprisingly matching only on the list of names and not the line before and after it. In reality the list is about 200 names long and can be much longer. I read somewhere that the limit for wildcards in triggers is 36.
So how do I turn that list of potentially hundreds of names into something like this:
so that I can compare them to a string value later?
After looking at that pattern I realize that every even numbered wildcard would be ", ". How do I group the comma and the space together without parenthesis so that it always matches either both or neither before a name without capturing them?
[EDIT] Corrected a few typos.
Here is a shortened example of what I see when I do CITY ENEMIES in Achaea.
Enemies of the City of Cyrene:
Rip, Achilles, Terrin'tuuran, Crythril, Jems, Ama-maalier, Artanis, Jack, Tesha, Cooper
Total: 10
Currently I'm testing using a world trigger with this regex pattern:
^((, )?([A-Z][-'a-z]*))*$And it works, surprisingly matching only on the list of names and not the line before and after it. In reality the list is about 200 names long and can be much longer. I read somewhere that the limit for wildcards in triggers is 36.
So how do I turn that list of potentially hundreds of names into something like this:
cityenemies.cyrene = {"Rip", "Achilles", "Terrin'tuuran", "Crythril", "Jems", "Ama-maalier", "Artanis", "Jack", "Tesha", "Cooper"}
so that I can compare them to a string value later?
After looking at that pattern I realize that every even numbered wildcard would be ", ". How do I group the comma and the space together without parenthesis so that it always matches either both or neither before a name without capturing them?
[EDIT] Corrected a few typos.