Exemplo n.º 1
0
        public static String GetNetRegex(DBNumerator numerator)
        {
            if (numerator == null || numerator.ExpressionRegexCode == null || numerator.ExpressionRegexCode == string.Empty)
            {
                return @"(?<number>\d*)";
            }
            else
            {
                var result = numerator.ExpressionRegexCode;
                var regex = new System.Text.RegularExpressions.Regex(@"<number[^>]*>");
                var m = regex.Match(numerator.ExpressionRegexCode);
                result = result.Replace(m.Value, "(?" + m.Value);

                regex = new System.Text.RegularExpressions.Regex(@"</number>");
                m = regex.Match(numerator.ExpressionRegexCode);
                result = result.Replace(m.Value, ")");

                return result;
            }
        }
Exemplo n.º 2
0
 public static String GetDevexpressRegex(DBNumerator numerator)
 {
     if (numerator != null ? (numerator.ExpressionRegexCode == String.Empty || numerator.ExpressionRegexCode == null) : true)
     {
         return @"\d*";
     }
     else
     {
         var result = numerator.ExpressionRegexCode;
         var regex = new System.Text.RegularExpressions.Regex(@"<number>|<number:\w*>|</number>");
         foreach (System.Text.RegularExpressions.Match m in regex.Matches(numerator.ExpressionRegexCode))
         {
             result = result.Replace(m.Value, string.Empty);
         }
         return result;
     }
 }