Hi,
Posting a similar question due to change in the requirements.
I need to split a Name field into First Name, Middle Name and Last Name. The values for the Name field could be as follows:
Name
----------------------
NameF ------- The FirstName should be NameF with MiddleName and LastName as Null.
NameF NameL ------ The FirstName should be NameF and LastName should be NameL with MiddleName as Null.
NameF NameM NameL ------ The FirstName should be NameF, MiddleName be NameM and LastName be NameL.
NameF NameM1 NameM2...NameMn NameL ------ The FirstName should be NameF, MiddleName be NameM1 NameM2...NameMn and LastName should be NameL.
Also, the NameF, NameM and NameL parts could contain a special character like Hyphen(-). For Ex,
NameF NameM1-NameM2 NameL - In this case the MiddleName should be NameM1-NameM2.
Could someone please help with any RegEx or any other parse solution for the above cases?
Thanks.