Wednesday, 15 April 2015

C# ASP.NET application Regular expression -



C# ASP.NET application Regular expression -

for c#, asp.net application - should simple, can't figure out regular expression, need list of strings text box can not submit value, , have ignore case.

example - no matter capitalization, need regular look reject next strings - abc, def, ghi

i can't regex reject one of them. tried next manner -

[regularexpression(@"(\w|^)(?i)!abc(?-i)(\w|$)", errormessage = "rejected!")] public string letters { get; set; }

that not work! seems reject everything. know should like? how can reject of them?

thanks help can provide!

quick , dirty, give seek (assuming understand problem correctly!)

^(?i)(?!(abc|def|ghi)(?-i)).*$

c# asp.net regex

No comments:

Post a Comment