Exemplo n.º 1
0
        private string CreateRegexPatternForQuantity <TUnitType>(IFormatProvider formatProvider) where TUnitType : Enum
        {
            var unitAbbreviations = _unitAbbreviationsCache.GetAllUnitAbbreviationsForQuantity(typeof(TUnitType), formatProvider);
            var pattern           = GetRegexPatternForUnitAbbreviations(unitAbbreviations);

            // Match entire string exactly
            return($"^{pattern}$");
        }