Method FindRegex
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
PageElementThe page to search. Must not be
null
.pattern
stringRegular expression pattern. Must not be
null
.regexOptions
RegexSearchOptionsRegex options (e.g., case-insensitive), maximum results, and context size. May be
null
for defaults.
Returns
Exceptions
- ArgumentNullException
Thrown when
page
orpattern
isnull
.
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
.pattern
stringRegular expression pattern. Must not be
null
.regexOptions
RegexSearchOptionsRegex search options. May be
null
for defaults.
Returns
Exceptions
- ArgumentNullException
Thrown when
pages
orpattern
isnull
.