fork download
  1. import re
  2. s = "this_is.an_Example string for.You"
  3. print(re.sub( r'(?<![^_.])[^\W_]+|[^\W_]+(?=[._])', lambda x: x.group().capitalize(), s))
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
This_Is.An_Example string For.You