factor-out paren finding from ex()