I've got this function that extracts strings from Inputstreams and returns a List<string>. It uses java.util.Scanner and java.util.regex.Pattern.
Problem is, it only seems to work the first time I call it. If I reverse my calls, again only the first one works, the second call never returns any matches.
List<String> lsphones = extract(is,pattern,0);
List<String> lsemails = extract(is,pattern",0);
I suspect I need to reset the Lists or something in the funciton -if not the function itself somehow. I've tried but keep getting exceptions when I do.
Thanks for any help.