Alias problem

Posted by Shawn on Tue 13 Mar 2001 11:18 AM — 2 posts, 13,348 views.

#0
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
Australia Forum Administrator #1
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