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
^([a-zA-Z]+)\s*,\s*([a-zA-Z]+)\s+([a-zA-Z]+)$
I think you are looking for this.just grab the groups to get your needs.See demo.
http://regex101.com/r/hQ1rP0/6