I want to extract a number with decimals from a string with one single expression if possible.
For example transform "2,123.02" to "2123.02" - my current solution is:
paste(unlist(str_extract_all("2,123.02","\\(?[0-9.]+\\)?",simplify=F)),collapse="")
But what I'm looking for is the expression in str_extract_all to just bind it together as a vector by themself. Is this possible to achieve with an regular expression?