2023-10-13 22:35:48 +03:00
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
|
|
|
|
namespace RhSolutions.QueryModifiers.DrinkingWaterHeatingFittings;
|
|
|
|
|
|
|
|
|
|
public class ThreadElbowWallInternal : DrinkingWaterHeatingFitting
|
|
|
|
|
{
|
|
|
|
|
protected override string _title => "Угольник настенный внутр. резьба";
|
2023-10-13 22:52:37 +03:00
|
|
|
|
private Regex _type = new(@"([\b\Wу])(?<Type>длин)([\b\w\.\s])");
|
2023-10-13 22:35:48 +03:00
|
|
|
|
protected override string? BuildRhSolutionsName(string query)
|
|
|
|
|
{
|
|
|
|
|
var diameterMatch = _diameter.Match(query);
|
|
|
|
|
if (!diameterMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
var threadMatch = _thread.Match(query);
|
|
|
|
|
if (!threadMatch.Success)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
var typeMatch = _type.Match(query);
|
|
|
|
|
string diameter = diameterMatch.Groups["Diameter"].Value;
|
|
|
|
|
string thread = threadMatch.Groups["Thread"].Value;
|
|
|
|
|
return $"{_title} {(typeMatch.Success ? "длинный " : string.Empty)}{diameter}-Rp {thread}";
|
|
|
|
|
}
|
|
|
|
|
}
|