Replace regex methods by string ones since faster

and more readable.