Tokenizing Strings

Andrew J Bromage ajb@spamcop.net
Wed, 2 Apr 2003 12:22:33 +1000


G'day all.

On Wed, Apr 02, 2003 at 11:26:46AM +1000, jamesd@mena.org.au 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:

	http://haskell.org/wiki/wiki?RunTimeCompilation

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

Cheers,
Andrew Bromage