I am looking at this sub-expression (this is in JavaScript):
(?:^|.....)
I know that ? means \"zero or one times\" when it fol
It flags the (parenthetical) group as a non-capturing group.
The notation for a non-capturing group is:
(?:)
In the instance you presented, the caret (^) is part of the expression not part of the capturing group notation. And this instance it's not a special character either.
It looks like they're using an 'or' operator (the pipe) with the caret. So they're looking to match something that is a caret or whatever was on the right of the pipe, but not capture the expression as a group (accomplished with the ?:
in the beginning of the grouping characters.
Non-capturing groups allow you to group an expression in a way that won't be back-refernceable, and will also increase performance of the expression.