title: Actionscript using \Q to ignore specials. Getting strange results
body: <p>thanks for reading my question.</p>
  
  <p>I am using a RegExp object in actionscript to simply test the occurrence of one string inside another.  Sometimes the Strings may contain RegEx special characters, i.e. "*".</p>
  
  <p>To handle that I have been concatenating \Q to the beginning of the search string, like so...</p>
  
  <pre><code>(String(reportItem[attributeToSearch])).search(new RegExp(("\Q" + searchText), "i"))
  </code></pre>
  
  <p>That is currently working for larger strings and for the string "<code>*</code>".
  However, I've come across a problem where the String I am searching is "projectiles, with bursting charge".  I am search for ",s" and it gives me back -1 as a result.  If I search the same thing without the \Q it works fine, but then the "<code>*</code>" case breaks.</p>
  
  <p>What gives?!</p>
  
  <p>Thanks in advance!</p>