Depending on how clean your data is, I think it will be difficult for you to find one regular expression that will do what you want. In what different formats do you expect the names to be? I had to write a similar code, and there can be many options: - first last - last first - first middle last - last, first middle
And you have things like suffixes (junior, oldest, third, etc.) and prefixes (Mr., Mrs., etc.), combined names (for example, John and Mary Smith). As mentioned earlier, you also have to deal with multi-part last names (e.g. Victor de la Hoya).
I found that I had to deal with all of these possibilities before I could reliably pull out the first and last name.
source share