Regular expression wildcard for multiple variables inside itself

Posted by ErockMahan on Thu 17 Oct 2013 11:04 PM — 4 posts, 18,782 views.

#0
Boy, that subject doesn't seem very clear! Examples are the best:


I have a variable:

<variables>
<variable name="customcommand">armorGG|blindTT</variable>
</variables>



I have a regex trigger:

^@leader tells you \'(@!customcommand)\'$



This works fine when:

LeaderMan tells you 'armorGG'
LeaderMan tells you 'blindTT'




But what If I want it to do both?

LeaderMan tells you 'armorGG blindTT'


I COULD (and currently do) split the string into individual pieces and individually analyzed, but my suggestion is that this could be simplified.
Australia Forum Administrator #1
I'm not sure a complex regexp is the best way to go here.

How about matching on


@leader tells you '*'


Then take whatever-it-was he told you and match it against the commands?
#2
You mean like:

if "%1"="armorGG" or "%1"="blindTT" then
world.execute "%1"
end if

?


Because this would work, I'm just trying to find a way to keep it simple. Trigger on:

@leader tells the group *
@leader tells you *
@leader whispers in your ear *

etc.

My workarounds (and yours) work fine, but like I said, it's an idea.
Australia Forum Administrator #3
Not exactly, I was thinking of some sort of table look-up.

You know what "leader" told you. You scan through some table looking for a match. If you find it, you do whatever the matched thing was supposed to do.