{-# OPTIONS_GHC -fno-warn-tabs #-} import Utilities import Data.List import Text.Regex.Posix main = do s <- getContents let pat = "(^.*)" -- pat = "(^.*)" foo = s =~ pat -- matches = getAllTextMatches foo :: [String] matches = getAllMatches foo -- $ (foo :: AllMatches [] (MatchOffset, MatchLength)) res = filter ok $ groupBy grp $ map (proc s) matches mapM_ print res proc s (x,y) = (x,y,take y $ drop x s) grp (a, b, c) (a', b', c') = a' == (a+b+1) ok xs = length xs>1