First, I am extremely NEW to regular expressions, so forgive my lack of knowledge.
My situation: I have a source directory with roughly 1000 program listings. I have a search tool that allows the use of straight text or regular expressions to search across the directory. A straight search won't work here.
I want to perform a search across all of the files and pickup only those that contain "word1" and "word2" (where "word1" could be a field name and "word2" could be a record name, etc). These words can be in the same line of code or 1 to N number of lines later (I'd like N to be configurable so that I can look for specific constructs).
I have found an example, using regular expressions, to search the source modules for 2 words/phrases in a single line separated by 1 to N words, but I cannot, thus far, figure out and/or find an example of a regular expression that will allow me to search across N multiple lines.
Can someone help me out here?
Thanks!
My situation: I have a source directory with roughly 1000 program listings. I have a search tool that allows the use of straight text or regular expressions to search across the directory. A straight search won't work here.
I want to perform a search across all of the files and pickup only those that contain "word1" and "word2" (where "word1" could be a field name and "word2" could be a record name, etc). These words can be in the same line of code or 1 to N number of lines later (I'd like N to be configurable so that I can look for specific constructs).
I have found an example, using regular expressions, to search the source modules for 2 words/phrases in a single line separated by 1 to N words, but I cannot, thus far, figure out and/or find an example of a regular expression that will allow me to search across N multiple lines.
Can someone help me out here?
Thanks!