at this regexp its giving warning bad syntax tag i finding how this issues 
will resolve di you know


On Monday, July 5, 2010 at 4:01:52 PM UTC+5, Archos wrote:
>
> Here I use a *simple* regexp. to validate email addresses, but it 
> doesn't validates like I expect. 
>
> It looks me that the regexp. is correct, isn't? 
>
> === 
> package main 
>
> import ( 
>         "fmt" 
>         "os" 
>         "regexp" 
> ) 
>
> const _EXP_EMAIL = `^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$` 
>
>
> func main() { 
>         exp, err := regexp.Compile(_EXP_EMAIL) 
>         if err != nil { 
>                 fmt.Println(err) 
>                 os.Exit(1) 
>         } 
>
>         if !exp.MatchString("foo...@hotmail.com <javascript:>") { 
>                 println("Invalid email") 
>         } 
>
>         println() 
> } 
> === 
> Invalid email 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f5577668-c079-46ea-a72c-0d84ea663e3c%40googlegroups.com.

Reply via email to