Skip to content

Regex.split with trailing \K works incorrectly #14467

Closed
@error256

Description

@error256

Elixir 1.18.3, Erlang/OTP 27.3.3

IO.inspect Regex.split ~r/b\K/, "ababab"
IO.inspect :re.split "ababab", "b\\K"

returns

["ab", "ab", "", "ab", "", ""]
["ab", "ab", "ab", ""]

I think Regex.split should return the same result as :re.split. Non-trailing \Ks and lookbehinds seem to work correctly, this is the only case.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions