如何将字符串拆分为名字和姓氏

how to split the strings into first name and last name

名单是:

[J. A. Rubiño-Martín, R. Rebolo, M. Aguiar, R. Génova-Santos, F. Gómez-Reñasco, J. M. Herreros, R.J. Hoyland, C. López-Caraballo, A. E. Pelaez Santos, V. Sanchez de la Rosa] 

我需要把它分成

[[J. A.], [Rubiño-Martín], [R.], [Rebolo], [M.], [Aguiar], [R.], [Génova-Santos], [F.], [Gómez-Reñasco], [J. M.], [Herreros], [R.J.], [Hoyland], [C.], [López-Caraballo], [A. E.], [Pelaez Santos], [V.], [Sanchez de la Rosa] 

使用 python 正则表达式

对于给定的输入,此正则表达式有效。第一组将匹配任意数量的标记,后跟一个点,以贪婪的方式多次匹配。第二组匹配最后一个点后跟一个或多个空格的所有内容。

^(.+\.)+\s+(.+)$

https://regex101.com/r/Jxy3Un/1

这是一个visualization:

但正如评论中指出的那样,如果您的名称不遵循这种相当严格的模式,它很容易崩溃。