I am trying to convert name of a certain format to FirstName Lastname. My regex is not working for all scenarios.
Regex I am using is: ^(\w+).*?(\w+)$
Parsing into 2 names and concatenating them. However, this is not working for cases 1 and 4.
Example: Trying to get Oscar Wilde from
Wilde, Oscar A. |
Wilde, Oscar |
Wilde Jr, Oscar |
Wilde Jr, Oscar Senior |
Solved! Go to Solution.
Because of the patterns you are suggesting, you probably won't be able to just use regex in this instance to parse everything exactly in one tool. I would suggest parsing it out first using the comma using the Text to Columns first. This would then allow you to complete the parsing using regex for both columns created no matter the pattern.
This expression works for these instances: ^(\w+)\s*\w*,\s(\w+).*$
In this case I might use the replace function in RegEx or a formula RegEx_Replace([field],"^(\w+)\s*\w*,\s(\w+).*$","$2 $1")
Thanks!
User | Count |
---|---|
109 | |
92 | |
78 | |
54 | |
40 |