Friends I have a list of words sorted out alphabetically in a text file(2MB) containing 300,000 words (1 word per line). Since it is already sorted, I want to make a quick string search which has to be exact and case insensitive. Any ideas how to do that?

Gotta make it as quick as possible and case insensitive. For instance,

If user needs to search word 'MAT' from the text file, the output must be mat/MAT and should not include mate, matted or any such words. The output should be generated in the least time.

EDIT - I need a solution like a class or algorithm to do it like Pattern/matcher or BufferedReader/Scanner, etc.