gint offset = 0;
gchar* tmp = NULL;
guint len = 0;
- guint pl = strlen(pattern);
+// guint pl = strlen(pattern);
+ GPatternSpec* regex;
+ regex = g_pattern_spec_new (pattern);
+
gboolean further = FALSE;
guint count = 0;
GArray* result = g_array_new(TRUE, TRUE, sizeof(gchar*));
while(i<min)
{
// check next words
- if(g_ascii_strncasecmp(tmp,pattern,pl) == 0)
+ if(g_pattern_match_string (regex, tmp) == TRUE)
{
gchar* new = g_strdup(tmp);
g_array_append_val(result,new);
g_free(g_array_index(result, gchar*, i));
}
g_array_free(result, TRUE);
+ g_pattern_spec_free (regex);
}
//------------------------------------------------------------------------------
/** \brief Search translation of word in dictionary.