title: How to extract numbers from a string?
body: <p>I have string contains a path</p>
  
  <pre><code>string="toto.titi.12.tata.2.abc.def"
  </code></pre>
  
  <p>I want to extract only the numbers from this string.</p>
  
  <p>To extract the first number:</p>
  
  <pre><code>tmp="${string#toto.titi.*.}"
  num1="${tmp%.tata*}"
  </code></pre>
  
  <p>To extract the second number:</p>
  
  <pre><code>tmp="${string#toto.titi.*.tata.*.}"
  num2="${tmp%.abc.def}"
  </code></pre>
  
  <p>So to extract a parameter I have to do it in 2 steps. How to extract a number with one step?</p>