in reply to minimal matching to end of string in regular expressions

If you want to be sure that you're matching the last right parenthesis:

$a =~ s/\)[^)]*$//;