title: Remove multiple occurrences of a specific character inside a fixed pattern with a single Regex
body: <p>First of all, I know how to solve this using two regex expressions but I was wondering if this can be done using just one.
  Please see <a href="https://regex101.com/r/A4V6FE/2" rel="nofollow noreferrer">this Regex101.com example</a> for the following explanation.</p>
  
  <p>Here's what I'm trying to do:
  I am given a .csv file, of which one line looks like this:</p>
  
  <blockquote>
    <p>AAA,AAA,AAA,AAA,some text and a comma here, and there, test,,,,,,,,,,</p>
  </blockquote>
  
  <p>The AAAs can be any length and any number/character. Those are the first four columns. The next part is </p>
  
  <blockquote>
    <p>some text and a comma here, and there, test</p>
  </blockquote>
  
  <p>This string can contain zero or multiple commas. Let's consider this as the <strong>fifth column</strong>, although technically it isn't right now. The rest is just <strong>always</strong> 10 commas:</p>
  
  <blockquote>
    <p>,,,,,,,,,,</p>
  </blockquote>
  
  <p>The goal is to only <strong>remove the commas inside the fifth column</strong> and return the whole line back. So from this:</p>
  
  <blockquote>
    <p>AAA,AAA,AAA,AAA,some text and a comma here, and there, test,,,,,,,,,,</p>
  </blockquote>
  
  <p>to this, notice the two removed commas:</p>
  
  <blockquote>
    <p>AAA,AAA,AAA,AAA,some text and a comma here and there test,,,,,,,,,,</p>
  </blockquote>
  
  <p><br>
  Here's how I did it in two steps.<br> First I get the fifth column using the first capture group with this regex:</p>
  
  <pre><code>(?:.*?,){4}(.*),{10}
  </code></pre>
  
  <p>Then I just use:</p>
  
  <pre><code>,
  </code></pre>
  
  <p>to match all commas and replace them with empty strings.</p>
  
  <p>My guess is that you'd need to use lookahead and lookbehind and I tried a lot of variations but I was not able to find any solution.<br>
  Is there a way to achieve this in one single regex?
  Thank you for reading.</p>