Bug Description
re.Split("", "abc") returns extra empty strings at the start and end compared to stdlib.
Reproduction
// stdlib
re := regexp.MustCompile("")
re.Split("abc", -1) // returns ["a", "b", "c"]
// coregex
re := coregex.MustCompile("")
re.Split("abc", -1) // returns ["", "a", "b", "c", ""]
Expected vs Actual
| Engine |
Result |
| stdlib |
["a", "b", "c"] |
| coregex |
["", "a", "b", "c", ""] |
Root Cause
The Split implementation does not handle empty pattern matching correctly at boundaries.
Impact
Applications using Split("", str) to split into characters get unexpected empty strings.