试试这个:
(?<=\()[^\)(]+(?=\)[^\)\(]+$)
解释:
<!--
(?<=\()[^\)(]+(?=\)[^\)\(]+$)
Options: ^ and $ match at line breaks; free-spacing
Assert that the regex below can be matched, with the match ending at this position (positive lookbehind) «(?<=\()»
Match the character “(” literally «\(»
Match a single character NOT present in the list below «[^\)(]+»
Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
A ) character «\)»
The character “(” «(»
Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=\)[^\)\(]+$)»
Match the character “)” literally «\)»
Match a single character NOT present in the list below «[^\)\(]+»
Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
A ) character «\)»
A ( character «\(»
Assert position at the end of a line (at the end of the string or before a line break character) «$»
-->