findAll

fun TextEditorState.findAll(query: String, caseSensitive: Boolean = false, wholeWord: Boolean = false, regex: Boolean = false): List<TextEditorRange>(source)

Find all occurrences of a query in the text editor. Matches never span a line break.

Plain queries report overlapping matches (aa twice in aaa); regular expressions report non-overlapping ones and skip empty matches, which cannot be highlighted or replaced.

Return

List of TextEditorRange for each match, in document order

Parameters

query

The string, or with regex the pattern, to search for

caseSensitive

Whether the search should be case-sensitive

wholeWord

Whether a match must not be preceded or followed by a letter, digit, or _

regex

Whether query is a regular expression in the platform's syntax. An invalid pattern finds nothing; see isValidFindPattern.