Trying to write a regex that can parse a full name and split it into first name, middle name, last name. This should be easy but its pretty hard once you see the kind of names I have to parse. Now I could write a big long regex that takes into accout all these different cases but I think a smaller dynamic regex is possible and that's why I am here asking for some help.
I think these are all of the types of names I have to grab.
Some example names that need to be parsed are(each have three commas at the end):
(first name) (middle intial). (last name),,, //one middle initial with period after
(first name) (last name),,, //simple first and last
(No name),,, //no name
(first name) (last name)-(last name),,, //two last names separated by a dash
(first name) (middle initial). (middle initial). (last name),,, //two middle initials with space inbetween
(first name) (last name w/ apostrophe),,, //Last names with apostrophes
(first name) (Middle name) (Last name),,, //first middle and last name
/(\S+ )?(\S+ )?(\S+ )?(\S+)?,,,/