CustomvarFlat: Don't ingnore special chars when splitting#1375
Merged
Conversation
8dd9caa to
e589b4f
Compare
nilmerg
requested changes
May 21, 2026
Two issues were fixed in the split regex: 1. Special characters before `.` were ignored: The old regex only split on `.` when directly preceded by a word character (\w), causing splits to be missed when `.` was preceded by special characters like whitespace, / or $. Result before: `foo /.bar.one` => `['foo /.bar', 'one']` Result after: `foo /.bar.one` => `['foo /', 'bar', 'one']` 2. Brackets mid-word were incorrectly split: The old regex split before any `[`, causing keys like `con[0]cat` to be split incorrectly. Resulti before: `con[0]cat` => `['con', '[0]cat']` Now splits before `[` only when it's a standalone array index — meaning `]` is followed by `.`, another `[`, or end of string. Result after: `con[0]cat` => `['con', '[0]', 'cat']`
e589b4f to
2aa3a33
Compare
Contributor
Author
|
nilmerg
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two issues were fixed in the split regex:
Special characters before
.were ignored:The old regex only split on
.when directly preceded by a wordcharacter (\w), causing splits to be missed when.was preceded by special characters like whitespace, / or $.Result before:
foo /.bar.one=>['foo /.bar', 'one']Result after:
foo /.bar.one=>['foo /', 'bar', 'one']Brackets mid-word were incorrectly split:
The old regex split before any
[, causing keys likecon[0]catto be split incorrectly.Now splits before
[only when it's a standalone array index — meaning]is followed by., another[, or end of string..) :disk[0].size => ['disk', '[0]', 'size'][):disk[0][1] => ['disk', '[0]', '[1]']disk[0] => ['disk', '[0]']Result before:
con[0]cat=>['con', '[0]cat']Result after:
con[0]cat=>['con', '[0]', 'cat']