RosettaCodeData/Task/Regular-expressions/Haskell/regular-expressions-1.hs
2023-07-01 13:44:08 -04:00

7 lines
155 B
Haskell

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