What's the most efficient way to search files in Java for specified patterns?

John Mitchell

Well, the simplest way is to read in each file via your input stream of choice and use one of the available regular expressions packages to implement your searching against that stream. Check out the list of regular expressions packages in Java for some helpful regexp packages.