Home » Archive by category "regex"

Regex in Haskell patterns

Have you ever wanted to do case expr of regexhere -> ... ?You can do almost that with view patterns!{-# LANGUAGE ViewPatterns #-}import Text.Regex.Posix-- Helperpat :: String -> String -> [[String]]pat p s = s =~ p-- Function with matchin...