コード例 #1
0
        protected override bool resolve(MatchingString ms)
        {
            MatchCollection mc;

            foreach (MatchingBlock mb in ms.GetAvaiableMatchingBlock())
            {
                if (m_featherfirst != null)
                {
                    mc = m_featherfirst.Matches(ms.MatchingBlockGetString(mb));
                    foreach (Match m in mc)
                    {
                        if (m.Success)
                        {
                            ms.AddMatchingBlock(this, mb, m.Index, m.Length);
                            if (m_IsSingleMatch)
                            {
                                return(false);
                            }
                        }
                    }
                }

                if (m_feathersecond != null)
                {
                    mc = m_feathersecond.Matches(ms.MatchingBlockGetString(mb));
                    foreach (Match m in mc)
                    {
                        if (m.Success)
                        {
                            ms.AddMatchingBlock(this, mb, m.Index, m.Length);
                            if (m_IsSingleMatch)
                            {
                                return(false);
                            }
                        }
                    }
                }

                if (m_featherthird != null)
                {
                    mc = m_featherthird.Matches(ms.MatchingBlockGetString(mb));
                    foreach (Match m in mc)
                    {
                        if (m.Success)
                        {
                            ms.AddMatchingBlock(this, mb, m.Index, m.Length);
                            if (m_IsSingleMatch)
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
            return(false);
        }
コード例 #2
0
        protected override bool resolve(MatchingString ms)
        {
            int    index = 0;
            bool   IsContinue;
            string str;

            foreach (MatchingBlock mb in ms.GetAvaiableMatchingBlock())
            {
                foreach (string a in m_aggregate)
                {
                    IsContinue = true;
                    index      = 0;
                    while (IsContinue)
                    {
                        str   = ms.MatchingBlockGetString(mb);
                        index = str.IndexOf(a, index);
                        if (index > -1)
                        {
                            ms.AddMatchingBlock(this, mb, index, a.Length);
                            if (m_IsSingleMatch)
                            {
                                return(false);
                            }
                            index++;
                        }
                        else
                        {
                            IsContinue = false;
                        }
                    }
                }
            }
            return(false);
        }