Im trying to gain an understanding of capture groups using this example:
sentence = "the quick brown fox jumps over the lazy dog"
<_sre.SRE_Match object; span=(0, 9), match='the quick'>
error: unbalanced parenthesis at position 10
Looks like a typo, but I'll still provide an explanation.
You are escaping the opening parenthesis making it matching a literal
(, which makes the closing parenthesis at the end of the expression without an opening part, replace: