the following regex was posted in the vb.net forum for validading an e-mail address.
VB Code:
Dim regEx As New Regex("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$", RegexOptions.IgnoreCase)
when compiling with mcs (Mono), i get the following errors:
(i don;t know how to create regex)
./Main.cs(76,27): error CS1009: Unrecognized escape sequence `\w'
./Main.cs(76,27): error CS1009: Unrecognized escape sequence `\.'
anyone know how to fix this, or have a better option?




Reply With Quote