The example names that I am trying it on are here
O'Kefe,Shiley
Folenza,Mitchel V
Briscoe Jr.,Sanford Ray
Andade-Alarenga,Blnca
De La Cru,Feando
Carone,Letca Jo
O'Conor,Mole K
Daeron III,Lawence P
Randall,Jason L
Esquel Mendez,Mara D
Dinle III,Jams E
Coras Sr.,Cleybr E
Hsieh-Krnk,Caolyn E
Graves II,Theodore R
I am trying to capture everything before comma except the roman numbers and Sr.
|Jr.
suffix.
So if the name is like Andade-Alarenga,Blnca
I want to capture Andade-Alarenga
, but if the name is Briscoe Jr.,Sanford Ray
I just want Briscoe
.
the code I have tried is here
^((?:(?![JjSs][rR]\.|\b(?:[IV]+))[^,]))
also this one - ^(?!\w+ \A[jr|sr|Jr|Sr].*)\w+| \w+ \w+|'\w+|-\w+$
[Regex101 my code with example sets][1]