making a flexible alias
-
- Posts: 1
- Joined: Wed Nov 20, 2024 6:31 am
making a flexible alias
I would like to make an alias where the pattern is functionaly both ^opn$ and ^opn (.+) so that i can send opn, and perform an action, and then send opn n and perform a different action. is there a way to set this up in mudlet?
Re: making a flexible alias
You want to use a pattern like this. Basically, you are making a non-capturing group (the outer parentheses with the "?:" at the beginning of it), and inside that, you have an either or created by using the pipe character "|", so it will match EITHER nothing, because there are no characters before the pipe, or the captured group, after a space of course, (.+) after the pipe.
^opn(?:| (.+))$
^opn(?:| (.+))$