Generate String From Regex In Python