title: Sed creating duplicates
body: <p>I have used the command sed in shell to remove everything except for numbers from my string.</p>
  
  <p>Now, my string contains three 0s among other numbers and after running</p>
  
  <pre><code>sed 's/[^0-9]*//g'
  </code></pre>
  
  <p>Instead of three 0s, i now have 0 01 and 02.</p>
  
  <p>How can I prevent sed from doing that so that I can have the three 0s?</p>
  
  <p>sample of the string:</p>
  
  <pre><code>0      cat
  42     dog 
  24     fish
  0      bird
  0      tiger
  5      fly
  </code></pre>