Expand description
Character helpers shared by the structural matchers. The reference walks Python strings by code point; these helpers provide the same semantics over Rust byte offsets.
Functions§
- char_at
- The character starting at (or spanning)
byte_idx, if the index is a char boundary. - char_
before - The character ending just before
byte_idx, ifbyte_idxis a boundary. - py_
is_ word - Python
\wmembership (Unicode word character or underscore). - str_
find_ from - Python
str.find(sub, start, end). - str_
rfind_ in - Python
str.rfind(sub, start, end): last occurrence within[start, end). - walk_
back_ while - Walk to the start of the run of
predcharacters ending atbyte_idx(exclusive), like the reference’s backwardwhileloops. - walk_
forward_ while - Walk forward from
byte_idxoverpredcharacters, returning the end.