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

precedence of matches in `Re.alt`

Open ericmarkmartin opened this issue 4 years ago • 0 comments

When running the regular expression Re.rep1 (Re.alt [Re.epsilon; Re.any]) on a string "foobarbaz", we get the match "foobarbaz" (running Re.Group.Get (Re.exec re "foobarbaz) 0").

I know other regular expression libraries assign precedence highest to lowest from left to right within alternations and was wondering if there is a formal policy followed in ocaml-re for deciding which alternated expression gets precedence in a match.

ericmarkmartin avatar Aug 07 '20 14:08 ericmarkmartin