in reply to Regex - Matching prefixes of a word
Better then to write a real and robust parser for your command language.
First you have to invent the grammar and syntax for your commands. Once you have that structure made, you can start thinking of writing the parser:
Higher Order Perl has some good examples how to do this.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex - Matching prefixes of a word
by SuicideJunkie (Vicar) on Jul 28, 2009 at 14:42 UTC |