I wanted to remove closing parentheses, ")", in a string when there is no opening parenthesis ahead. Here are examples and my desired output.
string1= "1548-(2), 1549)"
string2= "1401-(15~145), 153), 156"
desired_string1= "1548-(2), 1549"
desired_string2= "1401-(15~145), 153, 156"
*Additional: Thank you for the answers, it works well but it doesn't for the following case:
additional = "1543-(2, 6), 1548-(2), 1549), 1334-(1~5), 1401-(15, 145)"
desired_additional = "1543-(2, 6), 1548-(2), 1549, 1334-(1~5), 1401-(15, 145)"