Is this from a lesson? It might help if you link it. The parentheses are used for “grouping” substrings together (I’m guessing this was covered in an earlier lesson, if not then that’s the term you want to search for).
Something about that regex is a little off
(? should be a syntax error, it’s now the starting syntax for certain extensions
(?= for example. Perhaps they should be escaped
\( or something, trying to capture the literal
) characters in the fourth string.
Edit: Just realised that they probably were escaped but were used as escapes in the formatted text on the forums so ignore the missing
\( comments. I’m pretty sure the intention of that line is not grouping but actually matching a literal parenthesis (with a quantifier ofc).