Can someone help me understand the syntax inside the replacement function?
What you see is a regular expression. Regular expressions have special syntax for specifying patterns.
In this regular expression, means a group of characters . Here the group of characters is filled in (open bracket), (closing bracket) and (numbers). [...]\(\)\d
+ " " , , . , '142(2' .
, , .
, regex101. , , . , , .
, , :

"", , , , , , .