0
0
RhSolutions-Api/RhSolutions.Parsers/DrinkingWaterHeatingFittings/Adapter.cs

24 lines
516 B
C#

using System.Text.RegularExpressions;
namespace RhSolutions.Parsers.Fittings;
public abstract class Adapter : DrinkingWaterHeatingFitting
{
public override bool TryParse(string input, out string output)
{
output = string.Empty;
Match diameter = _diameter.Match(input);
if (!diameter.Success)
{
return false;
}
Match thread = _thread.Match(input);
if (!thread.Success)
{
return false;
}
output = $"{_title} {diameter.Groups["Diameter"]} {thread.Groups["Thread"]}";
return true;
}
}