I'm making a date matching regex, and it's all going pretty well, I've got this so far:

"/(?:[0-3])?[0-9]-(?:[0-1])?[0-9]-(?:20)[0-1][0-9]/"

It will (hopefully) match single or double digit days and months, and double or quadruple digit years in the 21st century. A few trials and errors have gotten me this far.

But, I've got two simple questions regarding these results:

  1. (?: ) what is a simple explanation for this? Apparently it's a non-matching group. But then...

  2. What is the trailing ? for? e.g. (? )?

Edit
Report