title: Apply a dict to regex
body: <p>I have a string and I need to hide the important details. For e.g.</p>
  <pre><code>x='Dear Mr /Ms Shantanu your agr no 1234 is expired on 13/11/2020 with arrears. Pls pay the arrear amount at your nearest branch'
  </code></pre>
  <p>The output should look something like this...</p>
  <pre><code>Dear Mr /Ms xxxx your agr no xxxx is expired on xx/xx/xxxx with arrears. Pls pay the arrear amount at your nearest branch
  </code></pre>
  <p>I have tried the following 3 statements and it works as expected.</p>
  <pre><code>re.sub(r'agr no \d+', 'agr no xxxx', x)
  re.sub(r'expired on \d+\/\d+\/\d+','expired on xx/xx/xxxx', x)
  re.sub(r'Mr /Ms \w+','Mr /Ms xxxx', x)
  </code></pre>
  <p>But there are a few more patterns. I have a dict that I need to apply to regular expression.</p>
  <pre><code>myreplace= {'agr no \d+': 'agr no xxxx', 'expired on \d+\/\d+\/\d+':'expired on xx/xx/xxxx', 'Mr /Ms \w+':'Mr /Ms xxxx'}
  </code></pre>
  <p>What is the best way to achieve this?</p>