This expression looks for sequences of PHP arrays, either closed with ]
or )
with unnecessary trailing commas and captures the content divided into three parts, except by the comma itself. You can use it to search an replace in editors like VSCode like this:
Search:
([\])]),(\s*\n*\s*)([\])])
Replace:
$1$2$3
This should help update the compatibility of your code with versions previous to 7.3.