0
0
RhSolutions-Api/RhSolutions.MLModifiers/DrinkingWaterHeatingFittings/ManifoldG1.cs
Serghei Cebotari 73275fa29e
All checks were successful
Test API / test (push) Successful in 2m20s
Fix manifold regex
2024-01-29 12:15:25 +03:00

28 lines
646 B
C#

using System.Text.RegularExpressions;
namespace RhSolutions.MLModifiers.DrinkingWaterHeatingFittings;
[MLModifierKey("Коллектор G1")]
public class ManifoldG1 : DrinkingWaterHeatingFitting
{
private static readonly Regex _portsCount =
new(@"\s(?<Ports>\d{1})\s");
protected override string _title => "Распределительный коллектор G1";
public override bool TryQueryModify(string input, out string output)
{
var match = _portsCount.Match(input);
if (match.Success)
{
output = $"{_title} {match.Groups["Ports"]}";
return true;
}
else
{
output = string.Empty;
return false;
}
}
}