Fixed search result printing with pattern search