List<String> list = new ArrayList<String>();
list.add("Test.Testing");
list.add("Test");
list.add("Testing");
String queryString = "*.*";
queryString = queryString.replaceAll("\\*" , ".*");
for (String str : list) {
if (str.matches(queryString))
System.out.println(str);
}
here expected answer should be Test.Testing
but it is returning all the data in the list.