How about ``grep -w -- #{escape(target)}`` ?