in reply to Explain regex ?: usage in grouping

To simplify Anonymous Monk's response, it is not the grouping of ?: but (?:...). By adding the ?:, you tell the regular expression engine to group (like mathematical parentheses) but not to store the result in a capture buffer. There are a number of side effects that might make you want to pick one or the other, but you are correct that it does not modify the gross behavior of the above snippet. They are documented in Non capturing groupings in perlretut.