in reply to Another regexp question
First, regexp is not the right tool for parsing/analyzing natural language.
However if you only expect sentences conform with certain predefined pattern/structure, then regexp (or some simple snippet) would be quite useful to analyze/parse those sentences. If all of your sentences are as simple as what you showed us above, I don't even think you need "multiple if's". It is all about understand and define the pattern/structure.
In your case, you may come up with those rules:
Then it is not difficult for you to come up with a short snippet or a regexp to parse your "sentences" into a collection of "subject-object" pairs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Another regexp question
by carric (Beadle) on Nov 19, 2003 at 07:26 UTC | |
by Wassercrats (Initiate) on Nov 19, 2003 at 08:03 UTC |