Python Regular Expression Pattern Matching Haskell