1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| #include <stddef.h> | #include <regex.h> | #include <tre-config.h> | int main(int argc, char *argv[]) | { | void* value = malloc(256); | regex_t preg = {.re_nsub = 4, .value = value}; | char const string [] = { | 'A', | 'B', | 'C', | 'D', | '\0'}; | regmatch_t pmatch = {.rm_so = 1, .rm_eo = 2}; | regamatch_t match = {.nmatch = 4, .pmatch = &pmatch, .cost = 3}; | regaparams_t params = { | .cost_ins = 4, | .cost_del = 5, | .cost_subst = 6, | .max_cost = 7}; | reganexec( | &preg, | string, | 4, | &match, | params, | 0); //target call | return 0; | } |
|