Given a string, which may end with a number within braces, how can I extract as separate variables: (1) the number; (2) the string, sans the braces and number?