looking at it that might be overkill. Does `gsub(/[^0-9]/, "")` look better to you?