title: Escaping parentheses in python regex
body: <p>I'm modifying an array of strings by applying a series of conversions to them. One of the conversions is to swap a country name in parentheses with the full name of that country.
  For example:</p>
  <p>Foo (GB) -&gt; Foo Great Britain</p>
  <p>I have an array of conversion objects of the form:</p>
  <pre><code>conversion.input_str = '(GB)'
  conversion.output_str = 'Great Britain'
  </code></pre>
  <p>And I'm trying to do it using regex, as follows:</p>
  <pre><code>for conv in conversions:
     match_expr = re.compile(rf'(\s|\b){conv.input_str}(\s|\b)')
     converted_str = re.sub(match_expr, conv.output_str, str_to_convert)
  </code></pre>
  <p>The \s and \b are there to prevent matches with word internal strings.
  All my conversions work except the parentheses one.</p>
  <p>If I use the plain <code>conv.input_str</code>, I get output of Foo ()</p>
  <p>If I try escaping using <code>re.escape(conv.input_str)</code> this seems to create the right match_expr but gives me Foo(GB).</p>
  <p>What am I doing wrong?</p>