in reply to How to match "text"?

There are only bytes, to decide how you interpret those bytes you have to use heuristics, or someone tells you -- there is no other way