in reply to Regular expression question
Then run the results of the split against the array or list of acceptable keywords (less the starting - of course).
Doing so would automatically invalidate the following cases:
As this split keeps leading and trailing whitespace, the leading and trailing whitespace cases are invalidated as well.
The only things you still have to do "by hand" is checking for incompatible combinations or multiple occurrences of the same keywords. This is left as an exercise for the readers.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|