stdDate.RegexMatch ignores options and looks up a different cache key
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 77/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend
調査の方向性
src/WIP/stdDate.cls の RegexMatch 付近(932行目と954~955行目)を読み、検索に使われるキャッシュキーと、保存および実行に使われるキーを比較してください。キーの検索を修正し、options パラメーターを反復処理してから、提供された Excel VBA の例で再現し、呼び出しの繰り返しとオプションの切り替えを確認してください。この例が AbC を返し、列挙されたオプションのケースが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
src/WIP/stdDate.cls at current blob b204aa6104d1dadbeb85b3381ed9c73f718c99ba contains two small defects in RegexMatch:
- The parameter is named
options, but lines 954–955 iterateflags. With noOption Explicit,flagsis an implicit Empty Variant, so the options loop never runs. - Line 932 reads
CachedRegex(pattern), while storage and execution useoptions & ")" & pattern. A missing Scripting.Dictionary Item read adds an Empty entry. The mismatch therefore rebuilds the RegExp on every call and adds an extra empty entry per unique pattern.
Minimal Excel VBA reproduction:
Dim d As Object
Set d = stdDate.RegexMatch("AbC", "(?<v>abc)", "i")
Debug.Print d("v")
Expected: AbC. Current source produces runtime error 5 because IgnoreCase remains False and the function indexes the empty match collection. With the three substitutions below, this call succeeds in a fresh Excel instance and in 1,000 repeated calls.
If Not CachedRegex.Exists(options & ")" & pattern) Then
' ...
For i = 1 To Len(options)
Select Case Mid(options, i, 1)
A separate instrumented local copy counted 10 RegExp creations for 10 calls before the fix and 1 afterward. Simple i/s/m/x/empty-option and option-switching cases passed, as did a full Excel VBE compile. Local patch/reference: https://github.com/Keunil/robotic-application/pull/1461
Timing improvement was inconsistent across two local A/A–A/B campaigns, and peak private bytes were similar. I am not claiming a measured speedup, absence of leaks, or that this caused any Excel process termination. Invalid-pattern cleanup and arbitrary unsupported options remain separate pre-existing boundaries.
- 主要言語
- VBA
- スター
- 412
- フォーク
- 70
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sancarn/stdVBA のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
似ている issue
-
status: waiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
spring-projects/spring-framework#37614 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pydantic/pydantic-ai#12091 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
paperclipai/paperclip#18396 ·
メンテナーはふだん 1 日以内に返信