In this case, it is ?actually used in connection with :. ?:Grouping , at the beginning of grouping means grouping, but not fixing the text / template in parentheses (as in, it will not be stored in any backlinks, such as \1or $1, so you will not have access to the grouped text directly).
More specifically, it ?has three different meanings in a regular expression:
? " " . , , - s?he, she, he, ? s ""
(+, *, ? {n,m}) ?, (.. , , )
A ? , . , : , . , ( ) :
. : (?:text)
B. Lookaround: (?=a) , ?! ?<= ?<! lookbehinds ( , ).
C. : (?(condition)then|else).
D. : a(?>bc|b)c ( abcc, abc, . )
E. / regex: ?i, , ?-i . / , , ?im (i , m - ).
F. : (?P<name>pattern), (?P=name). .NET regex (?<name>pattern).
G. Comments: (?#Comment text). , , , ... ((?x)).
, ? - . (, \(?, .