Commit 5d3ef2f
Fix regex anchoring to prevent false version matches
Fix critical regex bug where version detection could match unintended
versions. For example, searching for "3.2.8" could incorrectly match
"13.2.8" because the pattern wasn't anchored to the start of the line.
Changes:
- Add line-start anchor (^) to prevent matching partial strings
- Allow optional leading whitespace: ^[[:space:]]*
- Keep optional ruby- prefix: (ruby-)?
- Remove end anchor to allow patch suffixes (3.2.8-p123)
New pattern: ^[[:space:]]*(ruby-)?${version}
This ensures exact version matching at the start of each line while
still being flexible enough to match versions with or without the
ruby- prefix and with any patch suffix.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 06b7927 commit 5d3ef2f
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments