Created
December 29, 2013 02:40
-
-
Save thehydroimpulse/8166870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rc = pcre_exec( | |
re, /* the compiled pattern */ | |
NULL, /* no extra data - we didn't study the pattern */ | |
subject, /* the subject string */ | |
strlen(subject), /* the length of the subject */ | |
0, /* start at offset 0 in the subject */ | |
0, /* default options */ | |
ovector, /* output vector for substring information */ | |
OVECCOUNT); /* number of elements in the output vector */ | |
if (rc < 0) | |
{ | |
switch(rc) | |
{ | |
case PCRE_ERROR_NOMATCH: printf("No match\n"); break; | |
/* | |
Handle other special cases if you like | |
*/ | |
default: printf("Matching error %d\n", rc); break; | |
} | |
pcre_free(re); /* Release memory used for the compiled pattern */ | |
return 1; | |
} | |
/* Match succeded */ | |
printf("\nMatch succeeded at offset %d\n", ovector[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment