tech-misc archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Bug in TRE regular expression library
- Subject: Re: Bug in TRE regular expression library
- From: Ralf Junker <ralfjunker%gmx.de@localhost>
- Date: Tue, 20 Jul 2010 21:44:13 +0200
On 20.07.2010 20:39, Christos Zoulas wrote:
> Which example?
Sorry, I forgot it. It is now added below.
Ralf
-----------------------
#define p "(.)\\1$"
int _tmain(int argc, _TCHAR* argv[])
{
regex_t RE;
int nMatches, rc;
regmatch_t *matches;
TRE_MB_CUR_MAX = 2;
rc = tre_regncomp(&RE, p, strlen(p), REG_EXTENDED);
printf ("%d\n", rc);
nMatches = RE.re_nsub + 1;
matches = malloc (nMatches * sizeof(matches[0]));
rc = tre_regexec(&RE, "foox", nMatches, matches, 0);
printf("Result: %d\n", rc);
free(matches);
tre_regfree(&RE);
printf ("\nDone");
scanf ("*%s");
return 0;
}
Home |
Main Index |
Thread Index |
Old Index