fork(1) download
  1. test <- c("Testing $26,500\ntesting","Testing tesing $79+\n TOTAL: $79200","Testing $3880. Testing", "Testing -$69000Engine: $69000100%","Testing testing original price : $ 8 2 9 5 . Real price is $ 7 4 9 5")
  2. test <- gsub("([$]|(?!^)\\G)[\\s,]*(\\d)", "\\1\\2", test, perl=T)
  3. test <- gsub("^(?|[\\s\\S]*-[$](\\d+)|[\\s\\S]*[$](\\d+))[\\s\\S]*$", "\\1", test, perl=T)
  4. test
Success #stdin #stdout 0.47s 79168KB
stdin
Standard input is empty
stdout
[1] "26500" "79200" "3880"  "69000" "7495"