指定された文字列の引用符の内容と一致する必要がある構成ファイルのスニペットがありますが、コメントアウトされていない場合のみ、現在の正規表現は次のとおりです。
(?<!=#)test\.this\.regex\s+\"(.*?)\"
私はこれがうまくいくべきだと思いますか?私は次のように読みました。
(?<!=#)
後読みして、前に#
test\.this\.regex\s+\"(.*?)\"
マッチtest.this.regex "sup1"
ここに設定スニペットがあります
test.this.regex "sup1" hi |sup1| # test.this.regex "sup3" hi |sup3|
# test.this.regex "sup2" do |sup2|
test.this.regex "sup2" do |sup2|
しかし、私の正規表現は4回すべて一致します:
Match 1
1. sup1
Match 2
1. sup3
Match 3
1. sup2
Match 4
1. sup2