Regular Expression
-
hope this helps (go to "Validating Unicode Characters"): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000004.asp[^]
Good find. " Validating Unicode Characters Use the following code to validate Unicode characters in a page. using System.Text.RegularExpressions; . . . public class WebForm1 : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { // Name must contain between 1 and 40 alphanumeric characters // and (optionally) special characters such as apostrophes // for names such as O'Dell if (!Regex.IsMatch(Request.Form["name"], @"^[\p{L}\p{Zs}\p{Lu}\p{Ll}\']{1,40}$")) throw new ArgumentException("Invalid name parameter"); // Use individual regular expressions to validate other parameters . . . } } The following explains the regular expression shown in the preceding code: ^ means start looking at this position. \p{ ..} matches any character in the named character class specified by {..}. {L} performs a left-to-right match. {Lu} performs a match of uppercase. {Ll} performs a match of lowercase. {Zs} matches separator and space. 'matches apostrophe. {1,40} specifies the number of characters: no less than 1 and no more than 40. $ means stop looking at this position. " /\ |_ E X E GG