haskell-re2: re2 bindings for Haskell

re2 is a regular expression library offering predictable run-time and memory consumption. This library is a Haskell binding to re2.

Supported expression syntax is documented at https://github.com/google/re2/wiki/Syntax.

Code: https://john-millikin.com/code/haskell-re2 (GitHub mirror)

Example

$ ghci -XOverloadedStrings ghci> import Regex.RE2 ghci> find "\\w+" "hello world" Just (Match [Just "hello"]) ghci> find "\\w+$" "hello world" Just (Match [Just "world"]) ghci> find "^\\w+$" "hello world" Nothing
Change Feed