klyn.io.Path.searchText
method
public searchText(notnull pattern as String, options as SearchOptions = null) as ArrayList<SearchMatch>
Description

Searches this file or directory and collects non-overlapping occurrences. Symlinks are not followed. Memory includes results and the longest line.

Parameters
ParameterDescription
patternLiteral text, or regex when options.regex is true.
optionsSettings; null selects defaults.
Returns

Matches with one-based Unicode scalar line/column coordinates.

Throws
  • IOException for inaccessible files or malformed text.
  • NullException if pattern is null at runtime; statically null arguments are rejected with TypeError.
Example

hits = Path.cwd.searchText("TODO")