Next: , Previous: , Up: Top   [Contents][Index]


3 Precompiled regular expressions construction

Regular expression objects are built and finalised as follows:

cre2_regexp_t *   rex;
cre2_options_t *  opt;

opt = cre2_opt_new();
if (opt) {
  cre2_opt_set_log_errors(opt, 0);
  rex = cre2_new("ciao", 4, opt);
  if (rex) {
    if (!cre2_error_code(rex)) {
      /* successfully built */
    } else {
      /* an error occurred while compiling rex */
    }
    cre2_delete(rex);
  } else {
    /* rex memory allocation error */
  }
  cre2_opt_delete(opt);
} else {
  /* opt memory allocation error */
}

Next: , Previous: , Up: Top   [Contents][Index]

This document describes version 0.4.0-devel.2 of CRE2.