My program displays the matching results, but I want to sort the results as best match, second best match ans so on.
My text file contains the following line:
You have mixed pattern and search space. The line (strLine) is your search space and key is the pattern. Fix:
strLine
key
Pattern p = Pattern.compile(key); Matcher m = p.matcher(strLine);