just a simple question (hopefully): How can I search files contents for something like
Code: Select all
(Peter OR Paul) AND MarthaSecond, is it possible to search in "Office" AND "Text" files simultaneously?
Thanks heaps already,
Cheers David.P
Code: Select all
(Peter OR Paul) AND MarthaCode: Select all
(Peter|Paul)(?=.*Martha)No, just anywhere in the file!highend wrote:Are the names on the same line?
Code: Select all
(Peter|Paul).*[\s|\S](?=.*Martha)This is I believe imperfect (tested it). It will match Martha only on current line or the next one, but not anywhere further. Also, character | doesn't belong here: [\s|\S], unless you want to match "|".highend wrote:This could work:
Code: Select all
(Peter|Paul).*[\s|\S](?=.*Martha)
Code: Select all
(Peter|Paul)[\s\S]*?MarthaCode: Select all
(Peter|Paul)(?=[\s\S]*?Martha)Code: Select all
((Peter|Paul)[\s\S]*?Martha|Martha[\s\S]*?(Peter|Paul))Code: Select all
Note: Since larger files are read chunkwise (performance!) there are certain limits to the scope of your pattern: A pattern is guaranteed to be found if it matches a range of 1,024 bytes! It also *might* be found if it matches a range of 1,025 to 32,768 bytes! It will certainly not be found if it matches only an even larger range.