title: Extract numeric data from string in groovy
body: <p>I am given a string that can include both text and numeric data:</p>
  
  <p>Examples:</p>
  
  <p>"100 pounds"
  "I think 173 lbs"
  "73 lbs."</p>
  
  <p>I am looking for a clean way to extract only the numeric data from these strings.</p>
  
  <p>Here is what I'm currently doing to strip the response:</p>
  
  <pre><code>def stripResponse(String response) {
      if(response) {
          def toRemove = ["lbs.", "lbs", "pounds.", "pounds", " "]
          def toMod = response
          for(remove in toRemove) {
              toMod = toMod?.replaceAll(remove, "")
          }
          return toMod
      }
  }
  </code></pre>