[Haskell-cafe] Parsec: non-greedy 'between'

Scott Lawrence bytbox at gmail.com
Sun Sep 11 22:38:30 CEST 2011

Hey all,

Trying to match C-style comments, I have:

  between (string "/*") (string "*/") $ many anyChar

Which doesn't work, because it is equivalent (ignoring returned values) to

  do {string "/*"; many anyChar; string "*/"}

If the termination criterion was a single character, then I could use
noneOf or (satisfy . not), but that doesn't help here.

So... what am I missing?

Thanks in advance.

Scott Lawrence

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110911/1b28712a/attachment.pgp>

More information about the Haskell-Cafe mailing list