title: Why isn't my regex matching uppercase characters and underscores?
body: <p>I have the following Java code:</p>
  
  <pre><code>public static void main(String[] args) {
      String var = "ROOT_CONTEXT_MATCHER";
      boolean matches = var.matches("/[A-Z][a-zA-Z0-9_]*/");
      System.out.println("The value of 'matches' is: " + matches);
  }
  </code></pre>
  
  <p>This prints: <code>The value of 'matches' is: false</code></p>
  
  <p><strong>Why doesn't my <code>var</code> match the regex?</strong> If I am reading my regex correctly, it matches any String:</p>
  
  <ul>
  <li>Beginning with an upper-case char, A-Z; then</li>
  <li>Consisting of zero or more:
  <ul>
  <li>Lower-case chars a-z; or</li>
  <li>Upper-case chars A-Z; or</li>
  <li>Digits 0-9; or</li>
  <li>An underscore</li>
  </ul></li>
  </ul>
  
  <p>The String "<code>ROOT_CONTEXT_MATCHER</code>":</p>
  
  <ul>
  <li>Starts with an A-Z char; and</li>
  <li>Consists of 19 subsequent characters that are all uppper-case A-Z or are an underscore</li>
  </ul>
  
  <p>What's going on here?!?</p>