Exemplo n.º 1
0
        internal string CreateRegexPatternForUnit <TUnitType>(
            TUnitType unit,
            IFormatProvider formatProvider,
            bool matchEntireString = true)
            where TUnitType : Enum
        {
            var unitAbbreviations = _unitAbbreviationsCache.GetUnitAbbreviations(unit, formatProvider);
            var pattern           = GetRegexPatternForUnitAbbreviations(unitAbbreviations);

            return(matchEntireString ? $"^{pattern}$" : pattern);
        }