Rearrange name function

PHOTO EMBED

Sun Mar 28 2021 06:38:16 GMT+0000 (Coordinated Universal Time)

Saved by @FlorianC #python

import re

def rearrange_name(name):
	result = re.search(r"^([\w .]*), ([\w .]*)$", name)
	return "{} {}".format(result[2], result[1])
                       
content_copyCOPY

Note that the characters indicated in square brackets indicate the literal group of characters that the regex expression is supposed to fit, i.e. the " " and "." actually represent a space and a fullstop.