首页 > 解决方案 > 用于在版本中添加“build.counter”的文件内容替换器

问题描述

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

文件内容替换器

这是文件“AssemblyInfoVersion.cs”中的内容。

using System.Reflection;

[assembly: AssemblyVersionAttribute("3.0.1923.999")]

这是“文件内容替换器”的味精

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

我期待用“13468”替换“1923”。它没有什么。怎么了?

标签: regexteamcity

解决方案


尝试 (^\s*\[\s*assembly\s*:\s*AssemblyVersionAttribute\s*\(\"[0-9\*]+\.[0-9\*]+\.)([0-9\*]+\.)([0-9\*]+\"\)s*\])

+您的正则表达式模式中缺少最后一个。


推荐阅读