Ejemplo n.º 1
0
        public static string GetTextByReg(string sContent, string sRegex)
        {
            Match  match = new Regex(sRegex, RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline | RegexOptions.IgnoreCase).Match(sContent);
            string sOrg  = "";

            if (match.Success)
            {
                sOrg = match.Groups[0].Value;
            }
            while (sOrg.EndsWith("_"))
            {
                sOrg = CString.RemoveEndWith(sOrg, "_");
            }
            return(sOrg);
        }
Ejemplo n.º 2
0
        public static string GetTextByReg(string sContent, string sRegex)
        {
            Regex  re  = new Regex(sRegex, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline);
            Match  mc  = re.Match(sContent);
            string str = "";

            if (mc.Success)
            {
                str = mc.Groups[0].Value;
            }
            while (str.EndsWith("_"))
            {
                str = CString.RemoveEndWith(str, "_");
            }
            return(str);
        }