title: sed - how to remove everything but a defined pattern?
body: <p>I have to remove everything but 1, 2, or 3 digits (0-9, or 10-99, or 100) preceding <strong>%</strong> (I don't want to see the %, though) from another command's output and pipe it forward to another command. I know that</p>
  
  <pre><code>sed -n '/%/p'
  </code></pre>
  
  <p>will show only the line(s) containing <strong>%</strong>, but that's not what I want. How can I get rid of the rest of the unwanted text and leave only these numbers to then pipe them to another command?</p>