BeetleDev.com
info
contact
Saturday, December 15, 2018
Beetle Blog
Using regex to validate a string
By: douglas - C# - 4/28/2008 6:13:14 AM

The following will validate stringVariable to see if it matches an email pattern.

System.Text.RegularExpressions.Regex.IsMatch(stringVariable, "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");

There are double \ due to the language being C#.

 


Last Modified: 4/28/2008 6:13:14 AM

Beetle Blog v0.2.2


Copyright © 1997 - 2018 BeetleDev.com. All rights reserved.