in reply to Re: regular expression code not working
in thread regular expression code not working

I assume your conclusion is right. Depending on your data, you might even solve it with an easier regex:
s/\)$/\);/; # replace an ) at the end of the line with an );
HTH, Rata