I am trying to quickly find all .java files which contain one term but are missing another term. I'm using MyEclipse 10.7 and its 'Search | File Search' feature, which supports regular expressions.
Will regex work in this scenario? What would the correct regex be?
TIA, Steve
The only solution I could find to work is the following Regex:
^(?!.[\s\S]*MISSING_TERM).[\s\S]*INCLUDED_TERM.*$
It finds every file which includes INCLUDED_TERM but lacks MISSING_TERM, regardless of the line.
The key is the \s\S, which ensures the whole file is searched and not each line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With