Skip to content

precedence of matches in Re.alt #178

@ericmarkmartin

Description

@ericmarkmartin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions