check a text is before or after another text