title: Removing section between parenthesis on every line if present
body: <p>I have a file that I am inputting that has a bunch of lines that look like (* blah blah 4324 blah*) 23.  What I'm trying to do is remove everything between the parenthesis and keep the number that's just after the closed parenthesis.</p>
  
  <pre><code>ifstream infile{"nums.txt"};
  istream_iterator&lt;string&gt; infile_begin_iter {infile};
  istream_iterator&lt;string&gt; eof;
  vector&lt;string&gt; cleanNums {infile_begin_iter, eof};
  
  for(int i=0; i&lt;cleanNums.size(); i++){
      int openParen=cleanNums[i].find("(*");
      int closeParen=cleanNums[i].find("*)");
      int distance=openParen-closeParen;
      cleanNums[i].erase(closeParen, distance);
  }
  </code></pre>
  
  <p>That code keeps causing my program to crash and possibly you to cringe.  I have been looking around here for different things like getline but there I find it only shows me everything before the deliminator.  Thanks in advanced.</p>