Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mainPageCredRx=pcre_compile("class=\"credits_value\"[^<>]*>(\\d+)</sp",PCRE_CASELESS,&pcreErr,&pcreErrOffset,NULL);//so i need array of 4 integers : 2 for pattern and 2 for subpattern
- mainPageCredRxExtr=pcre_study(mainPageCredRx,0,&pcreErr);
- .....
- {
- int poss[5];//with a small margin
- char *cstr=(char*)buf.c_str();
- int flds=pcre_exec(mainPageCredRx,mainPageCredRxExtr,cstr,buf.length(),0,0,poss,5);
- /*we got:
- flds=0
- poss :
- [0] 5212 int
- [1] 5238 int
- [2] -1 int
- [3] -1 int
- [4] -858993460 int
- */
- }
- {
- int poss[10];//with a small margin
- int flds=pcre_exec(mainPageCredRx,mainPageCredRxExtr,cstr,buf.length(),0,0,poss,10);
- /*we got:
- flds=2
- poss :
- [0] 5212 int
- [1] 5238 int
- [2] 5230 int
- [3] 5234 int
- [4] -858993460 int
- [5] -858993460 int
- [6] -858993460 int
- [7] -858993460 int
- [8] 5230 int
- [9] -858993460 int
- */}
Advertisement
Add Comment
Please, Sign In to add comment