From 10379ebf90acd9622e4fccd9d4386ab3a69f4e9c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 3 Oct 2023 22:02:02 +0900 Subject: [PATCH] Support regexp in log-fix [ci skip] --- tool/lib/vcs.rb | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 13e74ac017..ace60f8f8e 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -707,12 +707,31 @@ class VCS range = b..b end case x - when %r[^s([#{LOG_FIX_REGEXP_SEPARATORS}])(.+)\1(.*)\1]o + when %r[^s([#{LOG_FIX_REGEXP_SEPARATORS}])(.+)\1(.*)\1([gr]+)?]o wrong = $2 correct = $3 + if opt = $4 and opt.include?("r") # regexp + wrong = Regexp.new(wrong) + correct.gsub!(/(?