data Match
A match: the matched text and its byte range [start, end) in the searched text.
Example:
fn main() io {
let re = Regex.compile("[a-z]+")!
let m = re.find("123 abc 456")!
print("{m.text} {m.start} {m.end}")
}Вывод
abc 4 7
@derive(Eq)
pub(api) data MatchС версии. 1.0.0-beta
Поля
pub(api) text: str | The matched text. |
pub(api) start: usize | Byte offset of the start of the match. |
pub(api) end: usize | Byte offset after the end of the match. |
Определено в: std/core/text.oxl:1115