Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
Hi All

i need to check user input for valid 2 format
the formats are
1) In the Matter of: <strInput 1>
2) <strOne 1> v <strTwo 1>

i have tryed by useing


if (Regex.IsMatch(_EntitleMent, @"?i^(?:in the matter of: <[a-z]+\d> | <[a-z]+\d> v <[a-z]+\d>)$"))

but no luck.

can one please guide me how can i write a Regular expression for above string format

please help
Posted

1 solution

You forgot to include \s for the blank space
(in the matter of: <[a-z]+\s\d>)|(<[a-z]+\s\d> v <[a-z]+\s\d>)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-May-11 1:44am    
Good catch, a 5.
--SA
ambarishtv 26-May-11 1:55am    
my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900