regex - 用于在版本中添加“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”。它没有什么。怎么了?
解决方案
尝试
(^\s*\[\s*assembly\s*:\s*AssemblyVersionAttribute\s*\(\"[0-9\*]+\.[0-9\*]+\.)([0-9\*]+\.)([0-9\*]+\"\)s*\])
+
您的正则表达式模式中缺少最后一个。
推荐阅读
- algorithm - 如何从数据集进行模拟?
- javascript - 错误的偏移量();在火狐上
- variables - Orange3 Python 小部件我无法汇总标记为元的列的值
- .htaccess - htaccess 将所有页面和子目录指向 index.php
- javascript - DXP中的第三方js问题
- java - 如何将 JTextArea 字符串更改为其他内容
- c# - 有没有办法在 C# 中将自动生成的值(增量整数)赋予字典键值对中的值
- node.js - 格式错误的属性选择器 Cheerio
- arrays - 在数组中切换 UIbuttons 以选择/取消选择
- python - 带递归的帕斯卡三角