new function, SearchPattern()