title: Replace multiple substrings at once
body: <p>Say I have a file, that contains some text. There are substrings like "substr1", "substr2", "substr3" etc. in it. I need to replace all of those substrings with some other text, like "repl1", "repl2", "repl3". In Python, I would create a dictionary like this:</p>
  
  <pre><code>{
   "substr1": "repl1",
   "substr2": "repl2",
   "substr3": "repl3"
  }
  </code></pre>
  
  <p>and create the pattern joining the keys with '|', then replace with <code>re.sub</code> function.
  Is there a similar simple way to do this in Java?</p>