A slight variation on that would be to have the hash indicate what to do rather than just what the word is. Split the command into words, and then follow the hash references to decide what to do, until you reach a code reference, or a !exists (indicating success or invalid command). It could be combined with the backwards regex trick, or the automatic regex generation to avoid having to list all substrings.
One challenge with that approach is how to deal with optional fields and variable length lists of parameters. I suppose that line of thought could quickly turn the project into a full LR parser / evaluator.
In reply to Re^2: Regex - Matching prefixes of a word
by SuicideJunkie
in thread Regex - Matching prefixes of a word
by SuicideJunkie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |