P
Praveen
looking for regex pattern for validating emailid
emailid can have a-z 0-9 - _ . (a to z, 0 ot 9, hyphen,undercore, dot)
here is a sample which I got from net which doesnt allow hyphen(-)
string
pattern=@"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
Modified the same t o
string
pattern=@"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-9]+([_][a-z|0-9]+)*)*([-][a-z|0-9]+([.][a-z|0-9]+([_][a-z|0-9]+)*)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
it works only for one hyphen (-)
Whats wrong here..
thanks in advance
praveen
emailid can have a-z 0-9 - _ . (a to z, 0 ot 9, hyphen,undercore, dot)
here is a sample which I got from net which doesnt allow hyphen(-)
string
pattern=@"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
Modified the same t o
string
pattern=@"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-9]+([_][a-z|0-9]+)*)*([-][a-z|0-9]+([.][a-z|0-9]+([_][a-z|0-9]+)*)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";
it works only for one hyphen (-)
Whats wrong here..
thanks in advance
praveen