title: convert to numeric : simplify 2 calls of gsub to one
body: <p>I would like to convert a vector of alphanumeric to numeric vector.  Right now , I am using regex but with 2 calls to <code>gsub</code>:</p>
  
  <pre><code>## wrapping this in function 
  to_numeric &lt;-
    function(x)    gsub(',','.',gsub("[^(\\d|,)]","",x,perl=TRUE))
  ## call it 
  to_numeric(c('a12,12','Atr 145 ',' 14 5,1 4A'))
  ## [1] "12.12"  "145"    "145.14"
  </code></pre>
  
  <p>How can I simplify this to one call, using unique regex or any other method?
  Thanks in advance.</p>