update regex, printToken function