[pcre-dev] How can get all matched substrings?

Etusivu
Poista viesti
Lähettäjä: funiu2000
Päiväys:  
Vastaanottaja: pcre-dev
Aihe: [pcre-dev] How can get all matched substrings?
Hi.
you known the "\g" flag that can matchs all matched substring in JavaScript, e.g:

src string: <html><title>abc</title></html>
pattern: <.*?>/g
then the result is: <html>,<title>,</title>,</html>

but with PCREAPI, I cannot get them.

src program:
-----------------------------
int sub_vec[768];
const char * cp_html_tag_remove1 = "<.*?>";
pcre * g_re_tag_remove = pcre_compile( cp_html_tag_remove1, PCRE_DOTALL|PCRE_CASELESS, &errptr, &erroffset, NULL );
int re = pcre_exec( g_re_tag_remove, g_re_extra, src, len, 0, 0, sub_vec, 768 );
...
-----------------------------
I could get the first matched substring only. why?
and how can I get all matched substrings???

thx!