title: find and replace exact match partial string (gsub)
body: <p>I have a dataframe with a variable (list) where is it possible to find special symbols. Please find below and example or my dataframe:</p>
  
  <pre><code> df_1 &lt;- data.frame(id=1:6,
   path.vec = I(list("apple", "lemon", "melon",c("apple", "banana","melon"),
   c("(Tuesday)/lemon", "lemon_Tuesday", "grape/ginger_peppers"),
   c("apple", "lemon", "apple"))))
   Recombine the path
  
  df_1$recombined = as.character(map(df_1$path.vec, paste, collapse = " &gt; "))
  </code></pre>
  
  <p>what I want to do is just to find and replace exact matches in my df_1$recombined</p>
  
  <p>I have been trying with gsub</p>
  
  <pre><code>df_1$recombined &lt;- gsub("\&lt;(Tuesday)/lemon\&gt;", "Tuesday", df_1$recombined, fixed =T)
  </code></pre>
  
  <p>this looks like running but it's not replacing any value.
  I have been browsing around and I have found that gsub doens't work well with special characters, so I have tried to with backslashes</p>
  
  <pre><code> df_1$recombined &lt;- gsub("\&lt;\(\Tuesday\)\/lemon\&gt;", "Tuesday", df_1$recombined, fixed =T)
  </code></pre>
  
  <p>but it doesn't change anyhting as well as square brackets:</p>
  
  <pre><code> df_1$recombined &lt;- gsub("\&lt;[(]Tuesday[)]/lemon\&gt;", "Tuesday", df_1$recombined, fixed =T)
  </code></pre>
  
  <p>both are running smoothly but not changing any value.</p>
  
  <p>Eventually I would like the below output:</p>
  
  <pre><code>final.recombined
  apple
  lemon
  melon
  apple &gt; banana &gt; melon
  Tuesday &gt; Tuesday &gt; Grape
  apple &gt; lemon &gt; apple
  </code></pre>
  
  <p>I think this is kind of easy but I can't understand what I'm doing wrong and since the special characters is gsub the best function to use in this situation? I will replace any string with special characters to get from 2 words just one.</p>
  
  <p>thanks!</p>