I'd like to search for text that may be split over several lines in a file. A grep that would ignore line breaks and return the matching span of lines.
e.g. I would be searching for is an example file
, and expect it to be found in the following file:
This is
an
example file.
Not to depend on leading or trailing spaces, entirely ignoring all forms of white space might be best (ideally, treating any sequence of white space as a single space).
One non-ideal solution is tr '\n' ' ' | grep
, that discriminates between matches and non-matches, but doesn't show the match, nor deals well with big files.
isearch-forward
)/This\_sis
. For more details::help \_s
.