search for: not_matched

Displaying 4 results from an estimated 4 matches for "not_matched".

2017 Aug 02
2
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...ng from your example above): > > let re = PCRE.compile "(a+)b" in > try > let m = PCRE.match re "ccaaaabb" in > let whole = PCRE.sub m 0 in (* returns "aaaab" *) > let first = PCRE.sub m 1 in (* returns "aaaa" *) > with Not_matched _ -> > ... That's what I was trying to avoid. I think the if statement with global state is much easier to use. > This makes it possible to stop thinking about what was the last saved > state, and even keep the multiple results of matches at the same time. I've converted...
2017 Aug 02
0
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...e captures? Something like (starting from your example above): let re = PCRE.compile "(a+)b" in try let m = PCRE.match re "ccaaaabb" in let whole = PCRE.sub m 0 in (* returns "aaaab" *) let first = PCRE.sub m 1 in (* returns "aaaa" *) with Not_matched _ -> ... This makes it possible to stop thinking about what was the last saved state, and even keep the multiple results of matches at the same time. Also the results are properly GC'ed once they get out of scope, and not linger until the thread finish (or the program shutdown). The dra...
2017 Aug 02
0
Re: [PATCH 0/2] Add lightweight bindings for PCRE.
...gt; > > let re = PCRE.compile "(a+)b" in > > try > > let m = PCRE.match re "ccaaaabb" in > > let whole = PCRE.sub m 0 in (* returns "aaaab" *) > > let first = PCRE.sub m 1 in (* returns "aaaa" *) > > with Not_matched _ -> > > ... > > That's what I was trying to avoid. I think the if statement with > global state is much easier to use. > > > This makes it possible to stop thinking about what was the last saved > > state, and even keep the multiple results of matches at...
2017 Aug 01
7
[PATCH 0/2] Add lightweight bindings for PCRE.
We'd like to use PCRE instead of the awful Str module. However I don't necessarily want to pull in the extra dependency of ocaml-pcre, and in any case ocaml-pcre is rather difficult to use. This introduces very simplified and lightweight 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