title: "Invalid escape sequence" when trying to use \w, \s, etc. in regular expression
body: <p>So this regex is so that I can find every type of method declaring of a java file. I believe this should get every instance of the java files I'm using this with but the problem is I keep getting the Invalid escape sequence (valid ones are  \b  \t  \n  \f  \r  \"  \'  \ ).</p>
  
  <p>Here is the string.</p>
  
  <pre><code>private String map = "(public|final|protected|private|static|\s) (final|static)* +[\w\&lt;\&gt;\[\]]+\s+(\w+) *\([^\)]*\) *(\{?|[^;]) {";
  </code></pre>
  
  <p>This is the part that the Eclipse IDE was erroring on.</p>
  
  <pre><code>(public|final|protected|private|static|\s)
  </code></pre>
  
  <p>I understand that there are allot of other similar posts on this but after searching about 10 of them I still couldn't figure out the problem. </p>
  
  <p>Thanks for any help.</p>