or just $gettok($2,-3,46)

$gettok supports negative indices, -1 means last token, -2 the one before that, etc