Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precedence of matches in Re.alt #178

Open
ericmarkmartin opened this issue Aug 7, 2020 · 0 comments
Open

precedence of matches in Re.alt #178

ericmarkmartin opened this issue Aug 7, 2020 · 0 comments

Comments

@ericmarkmartin
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant