我使用“文件内容替换器”将版本字符串中的"build.counter“替换为”build.counter“(13468)。

这是文件"AssemblyInfoVersion.cs“中的内容。
using System.Reflection;
[assembly: AssemblyVersionAttribute("3.0.1923.999")]以下是“文件内容替换器”的msg
File content replacer] Applying replacement "$113467$3" to lines matched by
pattern "(^\s*\[\s*assembly\s*:\s*AssemblyVersionAttribute\s*\(\"[0-9\*]+\.[0-9\*]+\.)([0-9\*]+\.)([0-9\*]\"\)s*\])"
in the files matched by wildcard: **/AssemblyInfoVersion.cs...
[14:28:44][File content replacer] Total files changed: 0.
[14:28:44][File content replacer] No modifications were made: either no
text matching the pattern was found or the replaced text is the same as the
original我希望把“1923年”改为"13468“。什么都没有。怎么啦?
发布于 2018-11-05 23:13:22
试试(^\s*\[\s*assembly\s*:\s*AssemblyVersionAttribute\s*\(\"[0-9\*]+\.[0-9\*]+\.)([0-9\*]+\.)([0-9\*]+\"\)s*\])
正则表达式模式中缺少最后一个+。
发布于 2018-11-05 23:13:09
原因是没有匹配,因为一个错误。检查这个正则表达式:
(^\s*\[\s*assembly\s*:\s*AssemblyVersionAttribute\s*\(\"[0-9\*]+\.[0-9\*]+\.)([0-9\*]+\.)([0-9\*]*\"\)s*\])我只在上一次**之后添加了一颗星‘[0-9\*]’。然后就匹配了。
https://stackoverflow.com/questions/53163547
复制相似问题