title: Invalid character range error in a new function
body: <p>I have a problem with the follwoing error message </p>
  
  <blockquote>
    <p>invalid regular expression '([a-Z]*)_(.*)', reason 'Invalid character range'</p>
  </blockquote>
  
  <p>so the line of code which causes the error is </p>
  
  <pre><code>if(tide=="long") names(problem) &lt;- sub("([a-Z]*)_(.*)","\\2",problem)
  </code></pre>
  
  <p>so if long is selected for the parameter tide in the function the names of problem shall be defined ....</p>
  
  <p>but when I enter <code>function(...,tide="long",..)</code> the above mentioned error message is displayed.</p>