I could not understand that question well. If one simply wants to extract some patterns from a text file, I guess PERL is a good candidate. Of course, one can use Java. I don't have PERL experiences. But I can do the job by using java.text.* package.