RosettaCodeData/Task/Regular-expressions/Haskell/regular-expressions-3.hs

8 lines
155 B
Haskell
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
import Text.Regex
str = "I am a string"
case matchRegex (mkRegex ".*string$") str of
Just _ -> putStrLn $ "ends with 'string'"
Nothing -> return ()