How can I remove the letters between two specific patterns in R?
For instance
a= \"a#g abcdefgtdkfef_jpg>pple\"
I would like to
Adding to the previous replies, if you work with a string that looks like "a#g abcdefgtdkfef_jpg>pple ; #__something_else___jpg>"
, some of these methods will sub the whole string with an expression like "#.*jpg>"
, and you will get an empty string as a result. To avoid that, you can use R regex "#[^jpg>]+jpg>"
that will allow you to match the pattern more selectively.