title: Invalid regular expression
body: <p>I am trying to match my pattern with an address on java.</p>
  
  <pre><code>String regex = "[a-zA-Z0-9,\\.\']";
  if(!address.matches(regex)) {
    //do something
  }
  </code></pre>
  
  <p>Basically, I'm hoping to detect all special characters except for <code>,</code>, <code>.</code>, <code>'</code>.
  With the code above, my address</p>
  
  <blockquote>
    <p>4700 Keele Street, North York, ON</p>
  </blockquote>
  
  <p>enters the if condition when it should not. Why is this happening ? 
  Also how do you escape a special character ? Shouldn't it be <code>\$</code>? Eclipse IDE prompts an error stating </p>
  
  <blockquote>
    <p>"Invalid escape sequence (valid ones
    are \b \t \n \f \r \” \' \ )"</p>
  </blockquote>
  
  <p>when I do <code>\$</code> or <code>\^</code>.</p>