Module find
Expand description
Implementation of string finding in ropes.
Enums§
- Case
Matching - A policy for case matching. There may be more choices in the future (for example, an even more forgiving mode that ignores accents, or possibly handling Unicode normalization).
- Find
Result - The result of a
findoperation.
Functions§
- compare_
cursor_ regex - Compare whether the substring beginning at the cursor location matches the provided regular expression. The substring begins at the beginning of the start of the line. If the regular expression can match multiple lines then the entire text is consumed and matched against the regular expression. Otherwise only the current line is matched. Returns the start position of the match.
- compare_
cursor_ str - Compare whether the substring beginning at the current cursor location is equal to the provided string. Leaves the cursor at an indeterminate position on failure, but the end of the string on success. Returns the start position of the match.
- compare_
cursor_ str_ casei - Like
compare_cursor_strbut case invariant (using to_lowercase() to normalize both strings before comparison). Returns the start position of the match. - find
- Finds a pattern string in the rope referenced by the cursor, starting at
the current location of the cursor (and finding the first match). Both
case sensitive and case insensitive matching is provided, controlled by
the
cmparameter. Theregexparameter controls whether the query should be considered as a regular expression. - find_
progress - A variant of
findthat makes a bounded amount of progress, then either returns or suspends (returningTryAgain). - is_
multiline_ regex - Checks if a regular expression can match multiple lines.