All pastes #886221 Raw Edit

Miscellany

public text v1 · immutable
#886221 ·published 2008-01-31 15:11 UTC
rendered paste body
import Text.Regex
import Data.Maybe (fromJust)

mail :: Regex
mail = mkRegex "[a-zA-Z0-9]+@[a-zA-Z0-9]+"

mailmatch :: String -> [String]
mailmatch s = fromJust $ matchRegex mail s

main = do
     s <- readFile "names"
     print $ map mailmatch $ lines s