title: Remove everything after a certain string
body: <p>I though this was going to be a simple task but I am having some trouble with it.</p>
  
  <p>Sample input</p>
  
  <pre><code>$ cat file.txt
  Brown Potatoes with Cheese
  Yellow Potatoes with Sugar and Cheese
  </code></pre>
  
  <p>I would like to use <code>sed</code> to remove everything after the string <strong>with</strong></p>
  
  <p>So the output would be</p>
  
  <pre><code>Brown Potatoes 
  Yellow Potatoes 
  </code></pre>
  
  <p>I've tried this regex but it doesn't seem to work.</p>
  
  <pre><code>sed -i -e "s/with.*//g" file.txt
  </code></pre>
  
  <p>Where did I go wrong?</p>