Table of Contents

Method FindRegex

Namespace
LMKit.Document.Search
Assembly
LM-Kit.NET.dll

FindRegex(PageElement, string, RegexSearchOptions)

Finds regular expression matches within a page's text and returns layout-aware results. The regex runs over the normalized page text (options are applied to the text, not the pattern).

public List<TextMatch> FindRegex(PageElement page, string pattern, RegexSearchOptions regexOptions = null)

Parameters

page PageElement

The page to search. Must not be null.

pattern string

Regular expression pattern. Must not be null.

regexOptions RegexSearchOptions

Regex options (e.g., case-insensitive), maximum results, and context size. May be null for defaults.

Returns

List<TextMatch>

An enumeration of TextMatch objects (possibly empty).

Exceptions

ArgumentNullException

Thrown when page or pattern is null.

FindRegex(IEnumerable<PageElement>, string, RegexSearchOptions)

Finds regular expression matches across multiple pages.

public List<TextMatch> FindRegex(IEnumerable<PageElement> pages, string pattern, RegexSearchOptions regexOptions = null)

Parameters

pages IEnumerable<PageElement>

Pages to search. Must not be null; a null entry (a page with no text layer) yields no match.

pattern string

Regular expression pattern. Must not be null.

regexOptions RegexSearchOptions

Regex search options. May be null for defaults.

Returns

List<TextMatch>

All regex matches across pages with (TextMatch) with PageIndex set.

Exceptions

ArgumentNullException

Thrown when pages or pattern is null.

Share