Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 16, 2012 08:06 PM by Mikesdotnetting
Member
102 Points
207 Posts
Nov 16, 2012 07:40 PM|LINK
Would someone give me the regex for a "lastname, firstname" as seperated by a ", " (comma with space), pretty pls
All-Star
154927 Points
19867 Posts
Moderator
MVP
Nov 16, 2012 08:06 PM|LINK
MAtching two strings separated by a comma is easy:
[\w\s]+,[\w\s]+
However, that will match any two strings seaprated by commas. There is no way to know that the strings are names. Also, what do you want to do with a match?
jjmonty
Member
102 Points
207 Posts
regex "lastname, firstname"
Nov 16, 2012 07:40 PM|LINK
Would someone give me the regex for a "lastname, firstname" as seperated by a ", " (comma with space), pretty pls
Mikesdotnett...
All-Star
154927 Points
19867 Posts
Moderator
MVP
Re: regex "lastname, firstname"
Nov 16, 2012 08:06 PM|LINK
MAtching two strings separated by a comma is easy:
[\w\s]+,[\w\s]+
However, that will match any two strings seaprated by commas. There is no way to know that the strings are names. Also, what do you want to do with a match?
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter