title: Regex: ?: notation (Question mark and colon notation)
body: <p>I have the following Java regex, which I didn't write and I am trying to modify:</p>
  
  <pre><code>^class-map(?:(\\s+match-all)|(\\s+match-any))?(\\s+[\\x21-\\x7e]{1,40})$
             ^                                 ^
  </code></pre>
  
  <p>It's similar to <a href="https://stackoverflow.com/questions/11529071/please-explain-this-java-regex">this one</a>.</p>
  
  <p>Note the first question mark. Does it mean that the group is optional? There is already a question mark after the corresponding <code>)</code>. Does the colon have a special meaning in regex?</p>
  
  <p>The regex compiles fine, and there are already JUnit tests that show how it works. It's just that I'm a bit confused about why the first question mark and colon are there.</p>