title: Java Regex: Why is the non-capturing group captured?
body: <p>I am using this regex in Java:  </p>
  
  <p><code>^(Mon(?:.?|day)?)(?:[\.,])?$</code> (This can be tested <a href="https://regex101.com/r/rg3PGl/1" rel="nofollow noreferrer">here</a>)</p>
  
  <p>I want to capture the day followed by an optional <code>.</code> or <code>,</code>.
  In case of the day Monday I want to capture either <code>Monday</code> or <code>Mon</code>. However, I don't want the optional <code>.</code> or <code>,</code> to be saved in a capturing group. This only seems to work for "Monday," not for "Mon." (see link).  </p>
  
  <p>How can I achieve this? </p>