title: Replace regex pattern to lowercase in java
body: <p>I'm trying to replace a url string to lowercase but wanted to keep the certain pattern string as it is. </p>
  
  <p>eg: for input like: </p>
  
  <pre><code>http://BLABLABLA?qUERY=sth&amp;macro1=${MACRO_STR1}&amp;macro2=${macro_str2}
  </code></pre>
  
  <p>The expected output would be lowercased url but the multiple macros are original:</p>
  
  <pre><code>http://blablabla?query=sth&amp;macro1=${MACRO_STR1}&amp;macro2=${macro_str2}
  </code></pre>
  
  <p>I was trying to capture the strings using regex but didn't figure out a proper way to do the replacement. Also it seemed using replaceAll() doesn't do the job. Any hint please?</p>