Remove new line char and return -1 if no match found between pattern and
text