title: uppercase to tittle() using RegEx
body: <p>I need to find all uppercased words in text and make them titled. I've been trying to do this using re.sub but I can't figure out what the second argument should be. I tried:</p>
  
  <pre><code>import re
  
  text = """
  This is SOME text that I HAVE to change
  I hope it WOULD work pretty EASY"""
  
  pattern = r'(?P&lt;b&gt;[A-Z])(?P&lt;a&gt;[A-Z]+)'
  
  re.sub(pattern, pattern.title(), text)
  
  print(text)
  </code></pre>
  
  <p>I guess I need to pass the match object as the second argument but I don't know how to do it.</p>