In R, I have a character string w
and would like to get rid of the SQL commented parts i.e. the characters between /*
and */
.
This is what I have tried so far, but it doesn't quite work....
w <- "ldsjflsdj /* hhhhhhhhsdlfjlsj */ dskfhjsdkjfhsd"
gsub("[/**/]","",w)
The ideal output would be something like:
`ldsjflsdj dskfhjsdkjfhsd`
How do I achieve this?
I am pretty sure it's simple I'm just not an expert in regex
Thanks,
HLM