Best way to do regexp search on file directory?

Hi,

I was wondering if anyone has any suggestions on how to do an efficient regexp search on a list of filenames (12000+) straight from a local physical directory?

The current method I am using is pulling up the directory in a File object and doing a wildcard filter on a subset of the files. Then taking this subset of files and doing the regexp matching on this short list. However, I find the I/O times to pull up the list of files everytime to be a bit too slow for our particular application.

any suggestions on how to improve this search?

Thanks!

[585 byte] By [hseikalya] at [2007-10-2 2:30:34]
# 1

> The current method I am using is pulling up the

> directory in a File object and doing a wildcard

> filter on a subset of the files. Then taking this

> subset of files and doing the regexp matching on this

> short list. However, I find the I/O times to pull up

> the list of files everytime to be a bit too slow for

> our particular application.

I'm not sure I understand what you mean. You are using a the listFiles() method, right? Are you passing it a custom FileFilter? Why not just pass a FileFilter that does the regex directly?

dubwaia at 2007-7-15 20:22:25 > top of Java-index,Other Topics,Algorithms...