extract_numeric("$1,200.34")
extract_numeric("-2%")
# The heuristic is not perfect - it won't fail for things that
# clearly aren't numbers
extract_numeric("-2-2")
extract_numeric("12abc34")
Run the code above in your browser using DataCamp Workspace