I have a string like:
q <-\" 1000-66329\"
I want to remove and get only 1000 66329
1000 66329
We can also do
trimws(gsub("\\S+\\s+|-", " ", q)) #[1] "1000 66329"