HI All,
I have example names here:
Kinsel-Davis, Elijah Sulaiman
Kinsel, Elijah S
Arrington, Melanie
I am trying to parse these into LastName, FirstName, Middle Name using RegEx.
I use this (^.+),(.+) and it works to break out the last and first name, but when I try to bring out the middle name, which can be absent, a single letter or a full name, I get odd returns. How do I account for a full name, a letter or blank with regex?
(^.+),(.+)?\s(.\>) does not work
Any help would be great
Solved! Go to Solution.
You could do something like: .+,\s(\w+) to get the middle name. This reads: find any character up to a comma (,) then a white space (\s) then a group which will be the middle name.
Why is melanie in as a middle name and not a first name?
If you have a moment, I would really love to know in plain english how this works. What does each segment do?
I took the regex class at Inspire this year and was good with it but forgot some of it due to lack of use. Thanks in advance.
(.*),\s{0,1}(\w+)\s*(.*)
Awesome. Thanks for the insight. Leave to the Alteryx community to always step it up!
User | Count |
---|---|
35 | |
27 | |
7 | |
7 | |
7 |