I have a PDF that i remove spaces from to be able to accurately extract someone’s name from the middle of the document. It completes the task perfect unless the person has a hyphen ( - ) in their last name. In this case, it only takes the first part of the last name.
I need to be able to get all of it.
Here is what I do so far.
Use Assign:
Name = System.Text.RegularExpressions.Regex.Match(Spaceless,“(?<=KellerPostmanrepresents).+(?=,a)”).ToString
How do I make the last name dynamic so that if the last name is written (i.e., Smith-Johnson) it grabs the entire last name but if it is just (i.e., Smith) it takes just Smith?
In the above picture, the example nSmith is the one that has hyphen. It seems the pattern you suggested took the last letter from the first name and put it in front of the last name.