public boolean checkMatchFNOrFI(String[] strArray,String value){ boolean flag = false; for(String s : strArray){ if(!s.equals("")){ String temp = s.replaceAll("\\?", "\\\\w").replaceAll("\\*", "\\\\w*"); flag = value.matches(temp); if(flag){ break; } } } return flag; }