Special characters are a curse in any language, not just R . Fortunately your problem has a simple solution using regular expressions I assume you want to end up with "The Tidy Verse"
hi @technocrat thanks! actually I would like to end up with "The Tidy, Verse"
How could we modify your code? Also, I would like to stick to pure regex without using the :alnum: shortcuts that we have in stringr.
:anum: is just sugar for [A-Za-z] and the ^ negates all the non-letters (not members of the bracketed class) and replaces them with single spaces. Then, to avoid too convoluted a regex to deal with the space separating the two parts of the inner list, I just piped to replace any run of blanks with just a single blank. So, let's refactor