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);
            }
        }
        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);
            }
        }
Example #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);
            }
        }