Skip to content

Conversation

@TwoFX
Copy link
Member

@TwoFX TwoFX commented Oct 27, 2025

This PR ensures that searching for an empty string returns the expected pattern of alternating size-zero matches and size-one rejects.

In particular, splitting by an empty string returns an array formed of the empty string, all of the string's characters as singleton strings, followed by another empty string. This matches the Rust behavior, for example.

@TwoFX TwoFX requested a review from kim-em as a code owner October 27, 2025 12:54
@TwoFX TwoFX added the changelog-no Do not include this PR in the release changelog label Oct 27, 2025
@TwoFX TwoFX enabled auto-merge October 27, 2025 12:54
@TwoFX TwoFX added this pull request to the merge queue Oct 27, 2025
Merged via the queue into leanprover:master with commit d2f76ad Oct 27, 2025
19 checks passed
TwoFX added a commit to TwoFX/lean4 that referenced this pull request Oct 29, 2025
This PR ensures that searching for an empty string returns the expected
pattern of alternating size-zero matches and size-one rejects.

In particular, splitting by an empty string returns an array formed of
the empty string, all of the string's characters as singleton strings,
followed by another empty string. This matches the [Rust
behavior](https://doc.rust-lang.org/std/primitive.str.html#method.split),
for example.
TwoFX added a commit to TwoFX/lean4 that referenced this pull request Oct 29, 2025
This PR ensures that searching for an empty string returns the expected
pattern of alternating size-zero matches and size-one rejects.

In particular, splitting by an empty string returns an array formed of
the empty string, all of the string's characters as singleton strings,
followed by another empty string. This matches the [Rust
behavior](https://doc.rust-lang.org/std/primitive.str.html#method.split),
for example.
TwoFX added a commit to TwoFX/lean4 that referenced this pull request Oct 29, 2025
This PR ensures that searching for an empty string returns the expected
pattern of alternating size-zero matches and size-one rejects.

In particular, splitting by an empty string returns an array formed of
the empty string, all of the string's characters as singleton strings,
followed by another empty string. This matches the [Rust
behavior](https://doc.rust-lang.org/std/primitive.str.html#method.split),
for example.
TwoFX added a commit that referenced this pull request Oct 29, 2025
This PR ensures that searching for an empty string returns the expected
pattern of alternating size-zero matches and size-one rejects.

In particular, splitting by an empty string returns an array formed of
the empty string, all of the string's characters as singleton strings,
followed by another empty string. This matches the [Rust
behavior](https://doc.rust-lang.org/std/primitive.str.html#method.split),
for example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-no Do not include this PR in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant