Displaying 8 results from an estimated 8 matches for "ccaaaabb".
2017 Aug 02
2
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...is some global state (actually
> > thread-local in this implementation) between the matching and the
> > getting the substring, so you can write code like this:
> >
> > let re = PCRE.compile "(a+)b"
> > ...
> >
> > if PCRE.matches re "ccaaaabb" then (
> > let whole = PCRE.sub 0 in (* returns "aaaab" *)
> > let first = PCRE.sub 1 in (* returns "aaaa" *)
> > ...
>
> Since we are providing a better module, with a different API (which
> needs changes), what about removing the u...
2017 Aug 02
0
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...> > thread-local in this implementation) between the matching and the
> > > getting the substring, so you can write code like this:
> > >
> > > let re = PCRE.compile "(a+)b"
> > > ...
> > >
> > > if PCRE.matches re "ccaaaabb" then (
> > > let whole = PCRE.sub 0 in (* returns "aaaab" *)
> > > let first = PCRE.sub 1 in (* returns "aaaa" *)
> > > ...
> >
> > Since we are providing a better module, with a different API (which
> > needs chang...
2017 Aug 02
0
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...work rather like Str in that there is some global state (actually
> thread-local in this implementation) between the matching and the
> getting the substring, so you can write code like this:
>
> let re = PCRE.compile "(a+)b"
> ...
>
> if PCRE.matches re "ccaaaabb" then (
> let whole = PCRE.sub 0 in (* returns "aaaab" *)
> let first = PCRE.sub 1 in (* returns "aaaa" *)
> ...
Since we are providing a better module, with a different API (which
needs changes), what about removing the usage of a global state, in
fav...
2017 Aug 02
2
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
On Wed, Aug 02, 2017 at 03:01:53PM +0200, Pino Toscano wrote:
> On Wednesday, 2 August 2017 13:52:06 CEST Richard W.M. Jones wrote:
> > I think you're suggesting this:
> >
> > let m = PCRE.exec re "ccaaaabb" in
> > if PCRE.matches m then (
> > let whole = PCRE.sub m 0 in
>
> Not really, my suggestion was to have a separate object representing
> the result of a regex match -- much like other language have in their
> regex APIs.
>
> OTOH, this solution LGTM as...
2017 Aug 03
0
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...work rather like Str in that there is some global state (actually
> thread-local in this implementation) between the matching and the
> getting the substring, so you can write code like this:
>
> let re = PCRE.compile "(a+)b"
> ...
>
> if PCRE.matches re "ccaaaabb" then (
> let whole = PCRE.sub 0 in (* returns "aaaab" *)
> let first = PCRE.sub 1 in (* returns "aaaa" *)
> ...
>
> I also introduced the switch from Str -> PCRE in virt-builder to show
> that it simplifies code while allowing you to use t...
2017 Aug 03
0
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...017 20:18:43 CEST Richard W.M. Jones wrote:
> On Wed, Aug 02, 2017 at 03:01:53PM +0200, Pino Toscano wrote:
> > On Wednesday, 2 August 2017 13:52:06 CEST Richard W.M. Jones wrote:
> > > I think you're suggesting this:
> > >
> > > let m = PCRE.exec re "ccaaaabb" in
> > > if PCRE.matches m then (
> > > let whole = PCRE.sub m 0 in
> >
> > Not really, my suggestion was to have a separate object representing
> > the result of a regex match -- much like other language have in their
> > regex APIs.
> >...
2017 Aug 01
7
[PATCH 0/2] Add lightweight bindings for PCRE.
...ghtweight bindings for PCRE.
They work rather like Str in that there is some global state (actually
thread-local in this implementation) between the matching and the
getting the substring, so you can write code like this:
let re = PCRE.compile "(a+)b"
...
if PCRE.matches re "ccaaaabb" then (
let whole = PCRE.sub 0 in (* returns "aaaab" *)
let first = PCRE.sub 1 in (* returns "aaaa" *)
...
I also introduced the switch from Str -> PCRE in virt-builder to show
that it simplifies code while allowing you to use the much more
powerful PCRE reg...
2017 Aug 01
6
[PATCH v2 0/3] common: Add a lightweight OCaml binding for PCRE.
v2:
- Change the OCaml code in the daemon to use PCRE instead of Str.
- Call pcre_compile2 so we can capture the error code on failure.
- Extend the test suite.
- Some other cleanups, but very minor.
Rich.