($number) = ($string =~ /\( (\d+) \) # number in parentheses [^()]* $/x); # at the end of the string