title: Java equivalent of Perl's s/// operator?
body: <p>I have some code that I'm converting from Perl to Java.  It makes pretty heavy use of regular expressions, including the <code>s///</code> operator.  I've been using Perl for a long time and am still getting used to the Java way of doing things.  In particular, Strings seem more difficult to work with.  Does anyone know of or have a Java function that fully implements <code>s///</code>?  So that it could handle something like this, for example:</p>
  
  <pre><code>$newString =~ s/(\bi'?\b)/\U$1/g;
  </code></pre>
  
  <p>(Maybe not a great example, but you get the idea.)  Thanks.</p>