Skip to content

Mistmatch on (A|B) when A is a prefix of B #12

Open
@sgbeal

Description

@sgbeal

Hiho,

i'm not sure if this qualifies as a bug, a corner case, or a known limitation:

regex: (match|matchAll)
input: match matchAll

when looping, that will match twice with these strings: ["match", "match"]

If the regex order is swapped, so that A is not a prefix of B (matchAll|match), then the result is as expected: ["match", "matchAll"].

Maybe a note in the docs suffices to cover this (maybe there is already one i overlooked).

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