I am looking for a way to replace all _ (by say '') in each of the following characters
x <- c('test_(match)','test_xMatchToo','test_a','test_b')
if and only if _ is followed by ( or x. So the output wanted is:
x <- c('test(match)','testxMatchToo','test_a','test_b')
How can this be done (using any package is fine)?
_(and_xwith''without using any regular expressions at all - It'll be faster and easier to read too._(with(and_xwithxgsub("_([(x])", "\\1", x), seems generic enough to me, though this is not "without using any regex", so maybe I'm misunderstanding.