/*  Compile with:   gcc -Wall -o g_regex_new `pkg-config --cflags --libs glib-2.0` g_regex_new.c */

#include <glib.h>

int main
(int argc, char *argv[])
{
  GRegex *regex = NULL;
  GError *error = NULL;
  /* Coming from https://easylist-downloads.adblockplus.org/easylist.txt */
  const gchar *gpatt = "/cdn-cgi/pe/bag?r[]=*cpalead.com";

/*  regex = g_regex_new (gpatt, G_REGEX_OPTIMIZE | G_REGEX_JAVASCRIPT_COMPAT, */
  regex = g_regex_new (gpatt, G_REGEX_OPTIMIZE,
                       G_REGEX_MATCH_NOTEMPTY, &error);

  if (regex) {
    g_print ("Success!!!\n");
    g_clear_pointer (&regex, g_regex_unref);
  }

  return (0);
}
