title: Extract number from format string in R
body: <p>Let's say I have a bunch of strings given in the format: <code>#%d-%d-%d</code>.</p>
  
  <p>For example, </p>
  
  <pre><code>#50-69-1
  #49-69-2
  ...
  </code></pre>
  
  <p>How can I extract the first number for every string without brute force approach by loop?</p>
  
  <p>For the example above I want to get:</p>
  
  <pre><code>50
  49
  ...
  </code></pre>