Regex match is not greedy
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 4.4k
- フォーク
- 993
- 平均マージ
- 9日 21時間
- マージ済み PR(30日)
- 1
説明
I am trying to get the pid of my process using Expect using the regex pidof service\\r\\n(\\d+)
It seems that if the service is running and a pid is returned, Expect is able to find it.
But if the service is not running, pidof returns empty so this regex doesn't work.
I changed the regex to pidof service\\r\\n(\\d*) but then it won't find the pid at all and simply returns the string
pidof service
It seems the issue could be that the first line of the incoming string pidof service\r\n would match that regex and Expect returns success and won't process further ?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ソースファイル、テスト、エントリーポイントのいずれも指定されていません。まず Expect と regex の処理箇所を見つけ、次に実行中のサービスと存在しないサービスについて pidof service\r\n のケースを再現してください。意図したマッチング動作が回帰テストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp
- 領域
- networking
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100