📜  在多个分隔符上拆分文本并放入列表 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:24.847000             🧑  作者: Mango

代码示例1
use regex::Regex; 

fn main() {
    // split text on multiple separators and put into a list
    let q = "The quick brown fox jumps over the lazy dog's back";
    let separator = Regex::new(r"([ ,.]+)").expect("Invalid regex");
    let words: Vec<_> = separator.split(q).into_iter().collect();
    println!("{:?}", words);
}