Beware that the lastname group will always be captured, even for the 1st case. Therefore to check which case it is you should compare the lastname group with String.Empty to see if they're equal or not and decide how to proceed.
You can see what I'm referring to in a regex editor such as Expresso. This would also help visualize your other question about (?:) usage. There are other editor options as well, check the sticky thread at the top of this forum for .net regex resources.Document my code? Why do you think it's called "code"?
Marked as answer byMattaniahFriday, December 19, 2008 3:39 PM
Friday, December 19, 2008 3:23 PM
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.