←back to thread

Parser Combinators Beat Regexes

(entropicthoughts.com)
120 points mooreds | 1 comments | | HN request time: 0.226s | source
1. kazinator ◴[] No.43639873[source]
> It uses the pcre-heavy Haskell library which in turn calls out to the system-wide pcre C library for actually compiling and running the regex.

That's not true regular expressions, but a backtracker with eclectic features.

The regex used in the regex solution is just:

  mul\((\d+),(\d+)\)
not requiring PCRE.

If Haskell happens to provide bindings to the POSIX regcomp/regexec stuff, that would be something to try instead. \d has to be replaced with [0-9], needless to say.