You could add:
(\s(jr|sr).){0,1} within the last set of parens so would look like:

^([a-z,A-Z,\.]+) ([a-z,A-Z]+(\s(jr|sr).){0,1})

This would handle those who do not put a period after the Jr or Sr also.


Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Feb 29, 2020, 05:40 -0800, 'anotherhoward' via BBEdit Talk , wrote:
> In a previous post, "Extracting parts of names from full names," I asked 
> about how to extract the first and last names from a string.
>
> Here is an input sample:
>
> Felix Jose\josefe01
> Tony Clark\clarkto02
> Matt Williams\willima04
> John McDonald\mcdonjo03
> Mark Grace\gracema01
> Steve Finley\finlest01
> B.J. Surhoff\surhob.01
> J.T. Snow\snowj.01
>
> When I re-examined the full dataset, I noticed two cases not included 
> previously.
> Eric Young Sr.\younger0
> Ken Griffey Jr.\griffke02
>
> Based on the helpful feedback I got in my previous post, now what I need is a 
> pattern that would handle not only all the original input items plus the two 
> new cases. Further, what I would like extracted is everything up to but not 
> including the backslash.
>
> This attempt (of mine) finds everything in the original dataset, but I was 
> unable to expand it to include either the "Sr." or "Jr.":
> ^([a-z,A-Z,\.]+) ([a-z,A-Z]+)
>
> 1. Is there a way my attempt can be expanded so it includes "Sr." or "Jr." 
> when a name has either of them?
> 2. What pattern would you write to accomplish the task?
> --
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "[email protected]" 
> rather than posting here. Follow @bbedit on Twitter: 
> <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/8a68d4b5-6d57-4c4c-8cd0-1ed5c30f85d5%40googlegroups.com.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/0cd00ad5-b756-464e-8403-e526d64d9d93%40Spark.

Reply via email to