TPDFlibSearchOption

Data Types

Description

TPDFlibSearchOption defines text searching rules such as case sensitivity, word boundary matching, diacritic folding, wildcard matching, cross-line matching, canonical equivalence, grapheme-cluster boundaries and replacement style preservation.

Syntax

Delphi

type TPDFlibSearchOption = (soCaseSensitive, soWholeWord, soDiacriticInsensitive, soWildcards, soAcrossLines, soPreserveStyle, soCanonicalEquivalent, soGraphemeClusters);

Values

soCaseSensitiveThe query match must respect case layout characters (uppercase and lowercase are treated as distinct).
soWholeWordMatches the query term only if it is surrounded by non-word characters (spaces, punctuation, etc.).
soDiacriticInsensitiveFolds both the query and the block text through a 1:1 Unicode fold (case plus Latin/Greek/Cyrillic accent removal) before comparing, so plain letters match their accented counterparts. Combine with soCaseSensitive to keep letter case significant while accents still fold.
soWildcardsTreats * and ? in the query as run and single-character wildcards.
soAcrossLinesLets a query span line breaks inside multi-line blocks; each break collapses to a single matchable space.
soPreserveStyleOnly affects SearchAndReplaceText: the replacement text inherits the hit block's text size and colour instead of the caller's current settings.
soCanonicalEquivalentNormalises the query and extracted text to canonical decomposition before matching, so NFC and NFD representations compare equally while hit offsets and lengths still address the original block text.
soGraphemeClustersRequires matches to begin and end on extended grapheme-cluster boundaries, protecting surrogate pairs, combining sequences, emoji ZWJ sequences, regional-indicator flags and Indic conjuncts. With soWildcards, ? consumes one complete cluster.

See also

TPDFlibSearchOptions, SearchText, TPDFlibSearchHit