1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| void test()
{
GRegex *pattern;
gchar *result, *string;
string =
g_strdup
("<b>GtkPerf 0.40</b> <span color=\"#737373\"><b>Graphics</b> test, <b>installed</b>\n</span><span color=\"#999999\"><small>This test calculates the average frame-rate from several different GTK operations.</small></span>");
pattern = g_regex_new(g_strdup("<(.|\n)*?>"), G_REGEX_DOTALL | G_REGEX_OPTIMIZE, 0, NULL);
result = g_regex_replace_literal(pattern, string, -1, 0, g_strdup(""), 0, NULL);
printf("string:\n%s\n\nresult:\n%s\n", string, result);
} |