title: replace element of string 3 - 10 positions after a pattern
body: <p>Ideally, in base R I need some kind of string manipulation that will let me detect a pattern and change the string 3 positions after the pattern.</p>
  <pre><code>    example &lt;- &quot;when string says SOMETHING = #c792ea&quot;
  </code></pre>
  <p>desired output:</p>
  <blockquote>
  <p>when string says SOMETHING = #001628</p>
  </blockquote>
  <p>I have tried gsub but I am not sure how I can get it to replace the characters after a pattern.</p>