Hi,

I'm currently in the middle of a project involving regular expressions. At first in my project I was using single files as an input for my regex to parse. However, I now need to change this for batch processing. What I need it to do is to check the directory that will be given to the system and will then parse through all the files and sub-folders containing files in that directory giving me my output. I am using INPUT as what is being matched on. I am not sure how to go about this and if anyone would be able to help I would be very grateful.

I have given some sample code below:

public class regexlib {
//creates the regex rules

public static String TO = "To: ((([a-z0-9\\.@]+)\\,?\\s*){1,})";
public static String INPUT = EnronGui.textlog
/* called from the EnronGui class. this will take the information in the text log area and will split the information using the method regexResults()*/

public void regexResults()
{
//Individual TO Emails
Pattern p = Pattern.compile(TO, Pattern.DOTALL);
Matcher m = p.matcher(INPUT);
if (m.find()) {
String data = m.toMatchResult().group(1);
p = Pattern.compile("([a-z0-9\\.@]+)\\,?\\s*", Pattern.DOTALL);
m = p.matcher(data);
while (m.find()) {
System.out.println(m.toMatchResult().group(0));

}
}

}