, , , ( char ) , ( ).
REGEX:
, , - :
boolean itFit;
List<String> results;
if (constraint != null && constraint.length() > 0) {
ArrayList<Integer> filterList = new ArrayList<>();
int iCnt = listItemsHolder.Names.size();
for (int i = 0; i < iCnt; i++) {
itFit = true;
if(listItemsHolder.Types.get(i).toString().indexOf("HEADER_")>-1){
continue;
}
for(String con : constraint.toString().split("\\s")) {
if (!listItemsHolder.Names.get(i).toLowerCase().contains(con.toLowerCase())) {
itFit = false;
}
}
if(itFit && !filterList.contains(i)){
filterList.add(listItemsHolder.Names.get(i));
}
}
results = filterList;
}
List<String>
, , . , , -. .
REGEX:
:
public String getRegEx(CharSequence elements){
String result = "(?i).*";
for(String element : elements.toString().split("\\s")){
result += element + ".*";
}
result += "@.*";
return result;
}
:
if (listItemsHolder.Names.get(i).toLowerCase().contains(constraint.toString().toLowerCase())) {
if (listItemsHolder.Names.get(i).matches(getRegEx(constraint))) {
\.
, , j bau
jeff.bauser@company.com
jerbauman@comp.com
. , , , , , , . f name l name
, firstname1.lastname1@company.com
.