Replace new lines in getNumberOfMatches