ocaml-re
ocaml-re copied to clipboard
precedence of matches in `Re.alt`
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.