title: Is there any need to escape the slash('/') character for regular expressions in Java
body: <p>I have the following code snippet:</p>
  
  <pre><code>Pattern patternOfSlashContainingBackSlash=Pattern.compile("\\/");
  Pattern patternOfSlashNotContainingBackSlash=Pattern.compile("/");
  
  String slash = "/";
  
  Matcher matcherOfSlashContainingBackSlash = patternOfSlashContainingBackSlash.matcher(slash);
  Matcher matcherOfSlashNotContainingBackSlash = patternOfSlashNotContainingBackSlash.matcher(slash);
  
  //both patterns match the slash
  System.out.println(matcherOfSlashContainingBackSlash.matches());
  System.out.println(matcherOfSlashNotContainingBackSlash.matches());  
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li><p>What is the difference (from Java perspective) between the two patterns, or is there any difference?</p></li>
  <li><p>Is the '/' character just a plain character for regex(not a special character like ']' is) ,from Java perspective?</p></li>
  </ol>
  
  <p>The java version on which I run this is 1.8</p>
  
  <p>This question is different from the others, since it makes it clear that the patterns "\\/" and "/" are the same for Java programming language.</p>
  
  <p>Thank you very much!</p>