title: How to replace different possible substrings (maybe even of different lengths) with a single substring?
body: <p>Suppose I have a huge string in following format -</p>
  <pre><code>&quot;blahblahblahrgb(123, 214, 255)blahblahrgb(99, 0, 235)aefubaeofbiuaebfaef&quot;
  </code></pre>
  <p>And I want to replace each instance of &quot;rgb(x,x,x)&quot; with &quot;rgb(255,255,255)&quot;, with rest of the cahracters in string left intact. I can't use default string replace method as values inside rgb() can vary.</p>
  <p>So the above string should become -</p>
  <pre><code>&quot;blahblahblahrgb(255, 255, 255)blahblahrgb(255, 255, 255)aefubaeofbiuaebfaef&quot;
  </code></pre>
  <p>Is there a default function to do that? or any efficient logic you can suggest?</p>
  <p>Python, Javascript, Java, Dart or any language would do.</p>