Sunday, May 19, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
97
rated 0 times [  104] [ 7]  / answers: 1 / hits: 24042  / 11 Years ago, tue, may 14, 2013, 12:00:00

How can I convert the following Regex statement into C#?



Match match = Regex.Match(line.Trim(), @/^[A-Za-z-.]+([,;]s?[A-Za-z-.]+)*$/, RegexOptions.IgnoreCase);
if (match.Success)
//do something


The pattern mentioned in the Match method is the one I picked from my javascript method.
It basically matches names such as Jane,Doe Jane;Doe Jane, Doe; Jack, Doe



Please advice.


More From » c#

 Answers
3

Remove / at the start and the end of the string.


[#78251] Sunday, May 12, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deanna

Total Points: 84
Total Questions: 86
Total Answers: 107

Location: Cyprus
Member since Wed, Dec 8, 2021
3 Years ago
;