title: How to include a right square bracket in a character class in R?
body: <p>This is addressed in <a href="https://stackoverflow.com/questions/16399483/when-punct-is-too-much">this</a> question and answered <a href="https://stackoverflow.com/questions/11427563/how-to-include-right-bracket-in-a-character-class">here</a> (and <a href="https://stackoverflow.com/questions/15255709/r-regex-remove-all-punctuation-except-apostrophe">this</a> question is also cited), but none of them actually answer the question -- the answer provided to the first question sidesteps the issue. The more general regex answer doesn't appear to work in R:</p>
  
  <pre><code>gsub('[\\]`]', '', '`]')
  # [1] "`]"
  </code></pre>
  
  <p>I'm trying to match a specific set of punctuation so <code>[:punct:]</code> is too general.</p>