Author: Titus von der Malsburg Date: To: pcre-dev CC: Tobias Günther Subject: [pcre-dev] position and match length for all matches of all
subpatterns separately
Dear list,
I have strings like "abcbccd" and patterns like "a(b(c)+)+d". I need
the positions and match lengths for all matches of all subpatterns.
Also, I need a way to select all positions and match lengths of a
particular subpattern, e.g. (c) in the above example. How can I
achieve this? My current idea is to transform the pattern from
"a(b(c)+)+d" to "a(?<1>b(?<2>c)+)+d", this is easy and allows me to
single out matches for a particular subpattern. But as far as I can
see, pcre_exec returns only information about the last match for every
subpattern.
I apologize if pcre-dev is not the appropriate list for this kind of
question, but I couldn't find a pcre-users list.