if (target === "filterRow" && selectedFilterOperations == 'contains') { return [function(dataItem) { var pattern = getter(value); //pattern = pattern.replace(/(?<!\.)\*/g, '[\\u0400-\\u04FF\\w]*'); pattern = pattern.replace(/@/g, '[\\u0400-\\u04FF\\w]'); pattern = pattern.replace(/,,/g, '.*'); pattern = pattern.replace(/,/g, '[\\u0400-\\u04FF\\w]*'); pattern = `(^|\\s|[^\\u0400-\\u04FF\\w]|\\b)${pattern}`; pattern = new RegExp(pattern, 'miu'); var cell = getter(dataItem[self.dataField]); if (cell.match(pattern)) { return true; } else { return false; } }, "=", true]; } else if (target === "filterRow") { return [function(dataItem) { var pattern = getter(value); //pattern = pattern.replace(/(?<!\.)\*/g, '[\\u0400-\\u04FF\\w]*'); pattern = pattern.replace(/@/g, '[\\u0400-\\u04FF\\w]'); pattern = pattern.replace(/,,/g, '.*'); pattern = pattern.replace(/,/g, '[\\u0400-\\u04FF\\w]*'); pattern = `(^|\\s|[^\\u0400-\\u04FF\\w]|\\b)${pattern}(?=\\s|[^\\u0400-\\u04FF\\w]|\\b|$)`; pattern = new RegExp(pattern, 'miu'); var cell = getter(dataItem[self.dataField]); if (cell.match(pattern)) { return true; } else { return false; } }, "=", true]; } else { return [function(dataItem) { return getter(dataItem[self.dataField]); }, selectedFilterOperations || 'contains', value]; } |