in reply to regular expression code not working
s/^\s*\)\s*($|\n)/);/;
s/\)$/\);/; # replace an ) at the end of the line with an ); [download]