Alias Matching a Shorter Alias That Begins the Same Way

Posted by Jai on Wed 03 Jun 2009 04:09 PM — 4 posts, 20,134 views.

#0
If I have an alias that begins in a way that matches another alias, the shorter alias is matched instead of the longer alias.

So if I have this to play a minorsecond at my variable target:
<aliases>
<alias
match="pmis"
enabled="y"
expand_variables="y"
regexp="y"
sequence="100"
>
<send>play minorsecond @kill_target</send>
</alias>
</aliases>

And this to play a minorsecond at something I only need to attack once and don't want to change targets:
<aliases>
<alias
match="pmisf *"
enabled="y"
expand_variables="y"
regexp="y"
sequence="100"
>
<send>play minorsecond %1</send>
</alias>
</aliases>

Trying to use the pmisf * alias only sets off the pmis alias. Is there a way to stop this? This is how I had all my aliases set up in zMUD, and I don't want to memorize (and unavoidably confuse myself with) a new system.
#1
Try this,


<aliases>
<alias
match="^pmis$"
enabled="y"
regexp="y"
sequence="100"
>
<send>play minorsecond @kill_target</send>
</alias>
</aliases>


Bast
Amended on Wed 03 Jun 2009 04:15 PM by Bast
USA #2
Bast's suggestion is what I'd use. Anchoring the alias wih ^ and $ (start of and end of line markers) avoids all confusion.

An alternate method though would be to lower the sequence number for the longer alias.


The pmisf isn't isn't going to work like you expect, either. You have it flagged as a regular expression but are using non-regexp syntax. If you uncheck the regular expression checkbox in the properties of the alias, and then click "Convert to Regular Expression" you'll see the pattern change from "pmisf *" to "^pmisf (.*?)$"
#3
Thank you both!