protected static bool match(SearchingMode _searchMode, String _typedString, String _string) { if (_typedString == null) { return(true); } if (_string == null) { return(false); } if (_searchMode == SearchingMode.WHOLE_STRING) { if (!_string.Equals(_typedString)) { return(false); } } if (_searchMode == SearchingMode.SUBSTRING) { if (!_string.Contains(_typedString)) { return(false); } } if (_searchMode == SearchingMode.REG_EXP) { Regex reg_ = new Regex(_typedString); if (!reg_.IsMatch(_string)) { return(false); } } if (_searchMode == SearchingMode.META_CHARACTER) { if (!StringList.match(_string, _typedString)) { return(false); } } return(true); }