bug fix: protected patterns in tokenizer, not detokenizer