title: Replace parts of a string in R
body: <p>I would like to be able to replace in the input below the <code>keywordN</code> by <code>tiab LIKE '%keywordN%'</code> to be able to translate the keyword input into an SQL string in R. Keywords are words or combinations of words for example: <code>((ELISA) OR (antibody test) AND (blood))</code></p>
  
  <pre><code>input = "((keyword1) OR (keyword2) AND (keyword3))"
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>output = "((tiab LIKE '%keyword1%') OR (tiab LIKE '%keyword2%') AND (tiab like '%keyword3%'))"
  </code></pre>
  
  <p>to be used like this:</p>
  
  <pre><code>sqlDF = sqldf(paste("select * from df1 where ",output))
  </code></pre>
  
  <p>Any suggestion? Much appreciated!</p>