优化 regex 和 dRegex 的正则表达式定义
这些更改使得正则表达式的定义更加简洁和一致。 具体来说,`\\.{0,1}` 被替换为 `\\.?`,`[\\d]+` 被替换为 `[\\d]*`, 以更好地匹配可能的输入格式。
This commit is contained in:
parent
143b0c3660
commit
d9e039f168
|
@ -17,10 +17,10 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
|||
/// <summary>
|
||||
/// 线径平方规格匹配
|
||||
/// </summary>
|
||||
public static readonly Regex regex = new("RV[\\d]+\\.{0,1}[\\d]+", RegexOptions.Compiled);
|
||||
public static readonly Regex regex = new("RV[\\d]+\\.?[\\d]*", RegexOptions.Compiled);
|
||||
/// <summary>
|
||||
/// 变色套平方规格匹配
|
||||
/// </summary>
|
||||
public static readonly Regex dRegex = new("V-[\\d]+\\.{0,1}[\\d]+", RegexOptions.Compiled);
|
||||
public static readonly Regex dRegex = new("V-[\\d]+\\.?[\\d]*", RegexOptions.Compiled);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue