title: Conditional regex replacement
body: <p>With Python, You can check if a group is empty before replacing text?</p>
  
  <p>Example:</p>
  
  <pre><code>[user] John Marshal   --&gt;   [user]&lt;br&gt;&lt;strong&gt;Jonh Marshal&lt;strong&gt;
  
  John Marshal   --&gt;   &lt;strong&gt;Jonh Marshal&lt;strong&gt;
  </code></pre>
  
  <p>The regex should use this is, but with the "condition" to insert the &lt; br> only if group 1 is found.</p>
  
  <pre><code>title = re.sub(r'^\s*(\[.*?\])?\s*(.*)', r'\1&lt;br&gt;&lt;strong&gt;\2&lt;/strong&gt;', title)
  </code></pre>