Ah so that's what it does! No sorry I have no experience with PCRE so I
can't help, @sigurdteigen knows better I'm sure.


On Tue, Jan 7, 2014 at 3:43 PM, Mikhail Gusarov <notifications@github.com>wrote:

> In libutils/string_lib.c:
>
> > @@ -441,6 +441,51 @@ bool StringMatchFull(const char *regex, const char *str)
> >      }
> >  }
> >
> > +Seq *StringMatchCaptures(const char *regex, const char *str)
> > +{
> > +    assert(regex);
> > +    assert(str);
> > +
> > +    pcre *pattern = NULL;
> > +    {
> > +        const char *errorstr;
> > +        int erroffset;
> > +        pattern = pcre_compile(regex, PCRE_MULTILINE | PCRE_DOTALL, &errorstr, &erroffset, NULL);
> > +    }
> > +    assert(pattern);
>
> Eh, this code is a copy/paste/fix from StringMatch, with is not good
> either.
>
> Any idea how to call a function which matches a regex against string and
> returns all the captured substrings?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cfengine/core/pull/1245/files#r8694345>
> .
>