Use bytes or unicode pattern depending on input text.