Minor readability / performance / deprecation improvements
Don't regex match unicode if the passed text is not unicode