

Task

   match a string against a regular expression
   substitute part of a string using a regular expression


import Text.Regex
 
str = "I am a string"
 
case matchRegex (mkRegex ".*string$") str of
  Just _  -> putStrLn $ "ends with 'string'"
  Nothing -> return ()