title: How to remove sequence of characters from string
body: <p>I want to remove an unknown number of character sequences B from a given string A.
  The removing must start to the right of the position of a character sequence C. The removing must stop when the B character sequence ends.</p>
  
  <p>Example for string A:</p>
  
  <pre><code>xxxxxxxxBxxxxxxxxxxxxxxxxxCBBBBBByyyyyyyyyByyyy
  
  A ... sequence of characters from which B's that follow C must be removed
  C ... a sequence of characters (example: 123)
  B ... a sequence of characters (example: vbz)
  x and y ... any characters
  </code></pre>
  
  <p>In this example all B's after C must be removed. All other B's must not be removed.</p>
  
  <p>The result would be:</p>
  
  <pre><code>xxxxxxxxBxxxxxxxxxxxxxxxxxCyyyyyyyyyByyyy
  </code></pre>
  
  <p>I tried to use:</p>
  
  <pre><code>A = A.replace("vbz","");
  </code></pre>
  
  <p>but that removes every 'vbz' sequence from A.
  How can I exclude the removal of those 'vbz' that are not preceeded by C?</p>
  
  <p>Regards, Manu</p>