ocaml-re icon indicating copy to clipboard operation
ocaml-re copied to clipboard

Doc: sem and rep_kind

Open obscurans opened this issue 7 years ago • 1 comments

Could you clarify that in Core, the longest/shortest/first/greedy/non_greedy combinators do not change which strings match the regex per execp, and only change the extent of capturing?

obscurans avatar Aug 10 '18 04:08 obscurans

longest/shortest/greedy/non_greedy do affect both matching and capturing. I guess what you mean is that if a string match the long (resp greedy) version, it will also match the short (non greedy) version. I do not remember if that is correct with all the operators we have in re, but I think it works in the posix subset.

I don't remember what's the semantics of first (I guess it only capture the leftmost instance). Which shows that it should be documented indeed. :D

Drup avatar Aug 16 '18 14:08 Drup