pattern search