title: What's wrong with this Regular Expression?
body: <p>In java, I'm trying to detect strings of the form: optional underline, capital letters, and then curly brackets encasing two parameters. I.e. things like <code>MAX{1,2}</code> <code>FUNC{3,7}</code> <code>_POW{9,10}</code></p>
  
  <p>I've decided to put off dealing with the parameters until later, so the regex I'm using is:</p>
  
  <pre><code>_?[A-Z]+//{.*//}
  </code></pre>
  
  <p>But I'm getting the following error when trying to compile it into a Pattern object:</p>
  
  <pre><code>Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition near index 9
  _?[A-Z]+//{.*//}
           ^
  </code></pre>
  
  <p>Anyone know what the problem is?</p>