Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Expanding variable groups in alias as regular expression

Expanding variable groups in alias as regular expression

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by ErockMahan   (81 posts)  Bio
Date Tue 06 Jul 2010 02:29 PM (UTC)
Message
A recent update allowed triggers to pull from a variable list seperated by | indicators by using (@!list), but I don't see that it works with an alias as well. That is:

<aliases>
<alias
match="^Test (@!item)$"
enabled="y"
expand_variables="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.note "matched item"</send>
</alias>
</aliases>

won't work but this will:

<triggers>
<trigger
enabled="y"
expand_variables="y"
keep_evaluating="y"
match="^You get (@!item)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.note "matched item"</send>
</trigger>
</triggers>

Has this not been implemented, or am I missing something?
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #1 on Tue 06 Jul 2010 08:11 PM (UTC)
Message
ErockMahan said:
Has this not been implemented, or am I missing something?


I've come across this too, and my guess is that it just hasn't been implemented in aliases.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 06 Jul 2010 09:44 PM (UTC)
Message
It hasn't been implemented in aliases. I think the reason was that for triggers, you may need to match many things (eg. colour the names of any of 1000 friends). However for aliases, you are less likely to be needing to do this.

A work-around for aliases is just to have something like "test *" and then in a script see if the wildcard matches a list of names. After all, aliases don't colour lines like triggers do.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,929 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.