
5 Jan
2007
5 Jan
'07
9:23 a.m.
tphyahoo wrote:
There are various haskell regex libraries out there,
Jules Bean wrote:
But that's such a perler attitude. When all you have is a regex, everything looks like a s///!
Not always, sometimes it is right to use regexes in Haskell also. If there are more than a few patterns to match in the same string, or if the patterns are more than a few characters long, then the simple approach will start becoming expensive. You need to use a more sophisticated algorithm - building up trees of potential matches, backtracking in some cases, etc. Why re-invent the wheel? Just use the regex library, where that is already done. Regards, Yitz