WORD_RE = re.compile('\\w+')

def capitalizeMatch(m):
    return m.group(0).capitalize()

def capitalizeWords(s):
    return WORD_RE.sub(capitalizeMatch, s)
CamelCase every string, any standard library?