Swap Name (Doe, John → John Doe)

A quick snippet for this, it goes from Doe, Jon to John Doe but not the other way round.

#popclip
name: Swap Name
icon: symbol:arrow.triangle.swap
after: paste-result
regex: '\w+, .+'
javascript: |
  const match = popclip.input.text.match(/([\w\-]+), (.+)/)
  if (match) return match[2] + ' ' + match[1]; else return null

(The above block is an extension snippet - select it to install the extension with PopClip)

Test inputs:
Bush, George
Bush, George Herbert Walker
Bush, George H. W.
Smith-Smythe-Smith, Tarquin