Maybe matchtok (#) is sufficient?
Code:
$matchtok($did(2).seltext,$chr(35),1,32)