diff --git a/lib/Text/Regex/TDFA.hs b/lib/Text/Regex/TDFA.hs index f8d5058..b8cb802 100644 --- a/lib/Text/Regex/TDFA.hs +++ b/lib/Text/Regex/TDFA.hs @@ -32,13 +32,19 @@ import "Text.Regex.TDFA" = Basics @ ->>> let emailRegex = "[a-zA-Z0-9+.\\_-]+\\@[a-zA-Z-]+\\.[a-z]+" ->>> "my email is firstname-lastname_1974@e-mail.com" =~ emailRegex :: Bool +>>> let emailRegex = "[a-zA-Z0-9+._-]+\\@[-a-zA-Z]+\\.[a-z]+" +>>> "my email is first-name.lastname_1974@e-mail.com" =~ emailRegex :: Bool True >>> "invalid@mail@com" =~ emailRegex :: Bool False +>>> "invalid@mail.COM" =~ emailRegex :: Bool +False + +>>> "#@invalid.com" =~ emailRegex :: Bool +False + /-- non-monadic/ λ> \ '=~' \ @@ -151,6 +157,12 @@ just [a]. The character classes like [:alnum:] are supported over ASCII only, valid classes are alnum, digit, punct, alpha, graph, space, blank, lower, upper, cntrl, print, xdigit, word. +@ +>>> getAllTextMatches ("john anne yifan" =~ "[[:lower:]]+") :: [String] +["john","anne","yifan"] + +@ + This package does not provide "basic" regular expressions. This package does not provide back references inside regular expressions.