}
static ESExpResult *
+func_regex_normal (struct _ESExp *f,
+ gint argc,
+ struct _ESExpResult **argv,
+ gpointer data)
+{
+ return func_field_test (E_BOOK_QUERY_REGEX_NORMAL, f, argc, argv, data);
+}
+
+static ESExpResult *
+func_regex_raw (struct _ESExp *f,
+ gint argc,
+ struct _ESExpResult **argv,
+ gpointer data)
+{
+ return func_field_test (E_BOOK_QUERY_REGEX_RAW, f, argc, argv, data);
+}
+
+static ESExpResult *
func_exists (struct _ESExp *f,
gint argc,
struct _ESExpResult **argv,
{ "eqphone", func_eqphone, 0 },
{ "eqphone_national", func_eqphone_national, 0 },
{ "eqphone_short", func_eqphone_short, 0 },
+ { "regex_normal", func_regex_normal, 0 },
+ { "regex_raw", func_regex_raw, 0 },
{ "exists", func_exists, 0 },
{ "exists_vcard", func_exists_vcard, 0 }
};
return "eqphone_national";
case E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER:
return "eqphone_short";
+ case E_BOOK_QUERY_REGEX_NORMAL:
+ return "regex_normal";
+ case E_BOOK_QUERY_REGEX_RAW:
+ return "regex_raw";
}
return NULL;
case E_BOOK_QUERY_CONTAINS:
case E_BOOK_QUERY_BEGINS_WITH:
case E_BOOK_QUERY_ENDS_WITH:
+ case E_BOOK_QUERY_REGEX_NORMAL:
+ case E_BOOK_QUERY_REGEX_RAW:
break;
}
* @E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER: check if a field matches with a value tested
* using e_phone_number_compare_strings(), the match must be at least of strength %E_PHONE_NUMBER_MATCH_SHORT
* for this query to return any matches.
+ * @E_BOOK_QUERY_REGEX_NORMAL: A regular expression query against contact data normalized with e_util_utf8_normalize(),
+ * the normalized data is lower case with any accents removed.
+ * @E_BOOK_QUERY_REGEX_RAW: A regular expression query against raw contact data, this is usually slower than
+ * a %E_BOOK_QUERY_REGEX_NORMAL as it implies that #EVCards must be parsed in order to get the raw data
+ * for comparison.
*
* The kind of test a query created by e_book_query_field_test() shall perform.
*
E_BOOK_QUERY_EQUALS_PHONE_NUMBER,
E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER,
- E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER
+ E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER,
+
+ E_BOOK_QUERY_REGEX_NORMAL,
+ E_BOOK_QUERY_REGEX_RAW
/*
Consider these "coming soon".