5

Help searching for patterns occuring near one another in document

view full story
linux-howto

http://www.unix.com – I'm very new to unix and linux, so I apologize if the answer to this question should be obvious.. What I would like to know is, is there a way to search a text document ( opened in less, or some other text viewer) for any two or more patterns that appear near one another in the document? In other words, if both strings appear in the document, but they are separated by too many characters, a match would not be returned, however, if they are within a certain number of characters from each other, they will be selected. (HowTos)