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, 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.
Entire forum
MUSHclient
General
Alias problem
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Shawn
(3 posts) bio
|
Date
| Tue 13 Mar 2001 11:18 AM (UTC) |
Message
| All right, at the risk of looking stupid, I need help figuring out aliases. When I transferred an .mca file from an older version of MUSHclient, a few things were added to the aliases:
OLD ALIAS: runhere sends: run ewsne
NEW ALIAS: ^runhere(.*)$ sends: run ewsne%1
The '^', '(.*)', '$', and the '%1' were added by the program (at least I imagine they were because I didn't do it :) ). What do these symbols do? And why were they added? I understand the %1 is a wildcard and will substitute text for the wildcard. However, in the help alias examples, I don't find an example of the other symbols in the particular position they are in.
What I'd like to do is to change them back to the original alias, however, if there is a better way to use the alias with these symbols, of course I'd rather have that.
Thank you | top |
|
Posted by
| Nick Gammon
Australia (23,043 posts) bio
Forum Administrator |
Date
| Reply #1 on Tue 13 Mar 2001 01:19 PM (UTC) Amended on Tue 13 Mar 2001 01:20 PM (UTC) by Nick Gammon
|
Message
| Earlier versions of MUSHclient had rather simple alias matching, namely:
* start of line
* entire line
* anywhere on line
To make aliases more sophisticated proper "wildcard matching" was introduced, and to retain the exact behaviour that they previously had they were turned into "regular expressions" that had the same effect.
You can turn them back into normal wildcards if you want, providing they act the way you expect.
The various symbols mean:
^ - match start of line
(.*) - match anything, return as %1
$ - match end of line
and in the "send string":
%1 is the first wildcard (%2 is the second wildcard and so on).
Aliases can now match on multiple wildcards if you want to.
To make your example simpler you can use an asterisk instead of the regular expression, eg.
Match on: runhere *
Send: run %1
Regular expression: not checked
|
- 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.
10,234 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.