15 re_set_syntax (RE_DEBUG);
16 reerr = regcomp (&re, "0*[0-9][0-9]", 0);
20 regerror (reerr, &re, buf, sizeof buf);
21 error (EXIT_FAILURE, 0, buf);
24 if (regexec (&re, "002", 2, ma, 0) != 0)
26 error (0, 0, "\"0*[0-9][0-9]\" does not match \"002\"");
29 puts ("Succesful match with \"0*[0-9][0-9]\"");
33 reerr = regcomp (&re, "[0a]*[0-9][0-9]", 0);
37 regerror (reerr, &re, buf, sizeof buf);
38 error (EXIT_FAILURE, 0, buf);
41 if (regexec (&re, "002", 2, ma, 0) != 0)
43 error (0, 0, "\"[0a]*[0-9][0-9]\" does not match \"002\"");
46 puts ("Succesful match with \"[0a]*[0-9][0-9]\"");