Skip to content

Substring matching + lookaround weird interaction #128

Description

@rgrinberg

Substring matches are able to "peek" outside of substrings when lookaround assertions are start/begin of the re. Here's an example of what I mean:

utop[19]> let re = Re.(compile @@ seq [bol ; str "xxx"]);;
val re : Re.re = <abstr>
utop[20]> Re.execp ~pos:1 ~len:3 re "yxxx";;
- : bool = false
utop[21]> Re.execp ~pos:1 ~len:3 re "\nxxx";;
- : bool = true

This means that there's no way for the user to independently match a substring. Not really broken but counter intuitive IMHO.

cc @Drup

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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