Posts

Showing posts with the label Regular Expression

Regular Expression For UNICODE Characters

char c = 'Ú' ; // 'Ÿ'; Console .WriteLine( "{0} U+{1:x4} {2}" , c, ( int )c, ( int )c); char MyChar = '\u0058' ; string x= Convert .ToString(MyChar); Regex reg = new Regex ( @"^[-0-9a-zA-Z\&\+\{\}\.\>\u0178\u00da''-'\s]{246}$" ); if (reg.IsMatch(sample)) Console .WriteLine( "matched" ); else Console .WriteLine( "UnMatched" );