コード例 #1
0
        public IEnumerable <ClassificationMatchResult> Matches(string text)
        {
            var match = Engine.Match(text);

            while (match.Success)
            {
                yield return(ClassificationMatchResult.Create(Type, match.Index, match.Length));

                match = Engine.Match(text, match.Index + match.Length);
            }
        }
コード例 #2
0
        public IEnumerable <ClassificationMatchResult> Matches(string text)
        {
            var match = Engine.Match(text);

            while (match.Success)
            {
                Group value = match.Groups["value"];
                if (value.Success && Candidates.Contains(value.Value))
                {
                    yield return(ClassificationMatchResult.Create(Type, value.Index, value.Length));
                }

                match = Engine.Match(text, match.Index + match.Length);
            }
        }
コード例 #3
0
        public IEnumerable <ClassificationMatchResult> Matches(string text)
        {
            var match = Engine.Match(text);

            while (match.Success)
            {
                for (int i = 0; i < GroupMappings.Length; i++)
                {
                    var mapping = GroupMappings[i];
                    var group   = match.Groups[mapping.Item1];
                    if (group.Success)
                    {
                        yield return(ClassificationMatchResult.Create(mapping.Item2, group.Index, group.Length));
                    }
                }

                match = Engine.Match(text, match.Index + match.Length);
            }
        }