title: Regex replace multiple groups
body: <p>I would like to use regular expressions to replace multiple groups with corresponding replacement string.</p>
  
  <p>Replacement table:</p>
  
  <ul>
  <li><code>"&amp;"</code> -> <code>"__amp"</code></li>
  <li><code>"#"</code> -> <code>"__hsh"</code></li>
  <li><code>"1"</code> -> <code>"5"</code></li>
  <li><code>"5"</code> -> <code>"6"</code></li>
  </ul>
  
  <p>For example, for the following input string</p>
  
  <pre><code>"a1asda&amp;fj#ahdk5adfls"
  </code></pre>
  
  <p>the corresponding output string is</p>
  
  <pre><code>"a5asda__ampfj__hshahdk6adfls"
  </code></pre>
  
  <p>Is there any way to do that?</p>