Say we have:
TestStrings <- c("Some number < 100", "Some number > 999", "Some number $1000", "Some number 1000000")
I want to replace all numbers with a space except numbers following the substrings:
"< \\d+" "> \\d+" "$\\d+"
What Regular expression could I write in function gsub() to complete such a task.
I know the follow code is wrong but here is what I have.
gsub(pattern = "^> \\d+|^< \\d+|^$\\d+", replace = " ", TestStrings)