When you say "something similar", do you mean takes a string and breaks it up into (say) the object and text pieces? If so, then you can use the Populate function to break a string apart. (This is the function the core code uses to parse commands.)
Here is an example:
pattern = "^tell (?<object>.*?) (?<text>.*?)$"
command = "tell apple hello"
name = "foo"
if (IsRegexMatch(pattern, command, name)) {
varlist = Populate(pattern, command, name)
msg (varlist)
} else {
msg ("Does not match")
}
Note it uses a real regex string, not the "#object#" stuff. As coded, this will print out:
Dictionary: object = apple;text = hello
It has parsed the regex match and extracted the values into a dictionary. I put the "IsRegexMatch" check ahead of it, because if the command doesn't actually match the pattern, then the game just errs out, which is not desirable generally.
So you really need to be sure the string matches before calling Populate.
The "name" part is actually a cache ID of sorts, if I understand it correctly. I believe what happens is that if you pass the same value to Populate that you passed to IsRegexMatch, then it will reuse the internal regex setup it used for the IsRegexMatch (so a sort of optimization).
If that's not what you were looking for, then if you could specify what part of the command line parsing you'd like in a script, I can try again.
Populate doc:
http://docs.textadventures.co.uk/quest/ ... ulate.html