Tokenizing Strings

Andrew J Bromage
Wed, 2 Apr 2003 12:22:33 +1000

G'day all.

On Wed, Apr 02, 2003 at 11:26:46AM +1000, wrote:

> in this case, I have a string containing multiples fields seperated by *two*
> blank lines (\n\n). I can't just break on the newline character, as single
> newline characters can be found inside each field.
> any idea how I can do this without too much hassle?

Here's some code I wrote some time ago which does Knuth-Morris-Pratt
string searching:

Note that there are a couple of differences between matchKMP and break
which you will no doubt discover.

Andrew Bromage