categorising tokens and regexp