complete regex-based tokenizer