I am trying to find the format \"abc, def g\" which is a name format \"lastname, firstname middlename\". I think the best suited method is regex but I do not have any idea i
I think this one will also work and a bit shorter than yours:
([A-Z][a-z]*)(?:,\s*)?
Or you can use split using this regex:
(,?\s+)