It is the match but don't capture. In regex processing everything within (
)
is considered fair game to be matched and captured. The distinction is the resulting data.
For to use it, one may want to verify that a match pattern exists; but one doesn't want all the material which makes up that match.
Why?
Say there is a rule that a user has to add dashes to a phone number such as 303-555-1234
. By using match but don't capture we can require a match with the dashes but we can extract the capture of just saving the numbers into a database.
(\d\d\d)(?:-)(\d\d\d)(?:-)(\d\d\d\d)
So then we require a full match of the above, but when we extract the captures we only get the digits.
Match 0 : 303-555-1234
Match 1 : 303
Match 2 : 555
Match 3 : 1234
I think of it as a way to provide an anchor to a match to make it complete but don't need all the data.
Similar can be found when using ExplicitCapture option to only capture all within (
)
but leave any non parenthesis out of the match.