BrightIdeasSoftware.TextMatchFilter.TextRegexMatchingStrategy.FindAllMatchedRanges C# (CSharp) Метод

FindAllMatchedRanges() публичный Метод

Find all the ways in which this filter matches the given string.

This is used by the renderer to decide which bits of the string should be highlighted.

this.Text will not be null or empty when this is called.

public FindAllMatchedRanges ( string cellText ) : IEnumerable
cellText string The text of the cell we want to search
Результат IEnumerable
            public override IEnumerable<CharacterRange> FindAllMatchedRanges(string cellText)
            {
                List<CharacterRange> ranges = new List<CharacterRange>();

                if (!this.IsRegexInvalid) {
                    foreach (Match match in this.Regex.Matches(cellText)) {
                        if (match.Length > 0)
                            ranges.Add(new CharacterRange(match.Index, match.Length));
                    }
                }

                return ranges;
            }