Gammon Forum
Entire forum
MUSHclient
General
RegExp -- completion
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Terry
USA (87 posts) bio
|
Date
| Fri 26 Jun 2009 03:11 PM (UTC) Amended on Fri 26 Jun 2009 03:14 PM (UTC) by Terry
|
Message
| Hey all! I couldn't find a board on regular expressions, so I thought I would just post it here in general.
In the past I was doing word completion where it would put in the various possibilities like this:<aliases>
<alias
match="^sc(o|or)?$"
enabled="y"
regexp="y"
sequence="100"
>
<send>score</send>
</alias>
</aliases>
In this example, it would match sc , sco , or scor , and input "score" . Although this is fine for short commands, I'm interested in allowing completion for arguments, etc., like with 'look' or 'kill'. Does anyone know of a way of handling completion in RegExp? Otherwise, I guess I'd have to use a Lua table, or something. =\
Thanks!
Terry
Edit: Btw, is there a RegExp board somewhere that I couldn't find? Thanks again! | top |
|
Posted by
| David Haley
USA (3,881 posts) bio
|
Date
| Reply #1 on Fri 26 Jun 2009 05:31 PM (UTC) |
Message
| I'm not aware of how you'd write a regex to do prefix matching, although it does seem that something like that could exist. I would indeed suggest using Lua, with some kind of table of words that you want to be completable. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | top |
|
Posted by
| Nick Gammon
Australia (22,973 posts) bio
Forum Administrator |
Date
| Reply #2 on Fri 26 Jun 2009 09:07 PM (UTC) |
Message
| I don't think a regexp would work really well for completion, because inside the regexp you would need all the possible words - which might be lengthy.
I think the table idea would work better. You know MUSHclient has tab-completion? And you can add to its custom completion table? You could simply put words like "look" and "kill" in it, type "lo" and hit tab. |
- 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.
12,121 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.