fork download
  1. import re
  2. rx = r"(\.[^a-zA-Z]*)([a-zA-Z])"
  3. text = "homEwork:\n\n it was a bright cold day in April, and the clocks were striking thirteen.\n\n\n\n the hallway smelt of boiled cabbage and old rag mats. at one end of it a coloured poster, too large for indoor display, had been tacked to the wall. \n\n\n\n winston turned a switch and the voice sank somewhat, though the words were still distinguishable. his hair was very fair, his face naturally sanguine.\n\n\n\n it was the police patrol, snooping into people's windows. the patrols did not matter, however. only the Thought Police mattered."
  4. print( re.sub(r'(\.[^a-zA-Z]*)([a-zA-Z])', lambda x: f'{x.group(1)}{x.group(2).upper()}', text) )
  5.  
Success #stdin #stdout 0.03s 9476KB
stdin
Standard input is empty
stdout
homEwork:

  it was a bright cold day in April, and the clocks were striking thirteen.



  The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. 



  Winston turned a switch and the voice sank somewhat, though the words were still distinguishable.  His hair was very fair, his face naturally sanguine.



  It was the police patrol, snooping into people's windows. The patrols did not matter, however. Only the Thought Police mattered.