All pastes #886296 Raw Edit

Someone

public text v1 · immutable
#886296 ·published 2008-01-31 16:07 UTC
rendered paste body
import Text.Regex
import Data.Maybe (fromJust)
mail :: Regex
mail = mkRegex "\\([a-zA-Z0-9]+\\)[[:blank:]]+\\([a-zA-Z0-9]+@[a-zA-Z0-9]+\\)" 

mainmatch s = case m of {
	Nothing -> [] ;
	Just (pre, mm, post, _) -> mm:mainmatch post 
} where m = Text.Regex.matchRegexAll mail s

main = do
      s <- readFile "names"
      let sout = mainmatch s in
          print sout