pub fn any_phrase() -> Token
Expand description
Matches all sequences of one or more words. Quoted phrases are treated as single words.
ยงExamples
use initiative_core::command::prelude::*;
let token = any_phrase();
assert_eq!(
vec![
// Ungreedily matches the quoted phrase as a single token,
FuzzyMatch::Overflow(
TokenMatch::new(&token, "badger badger"),
" mushroom snake ".into(),
),
// the first two "words",
FuzzyMatch::Overflow(
TokenMatch::new(&token, r#""badger badger" mushroom"#),
" snake ".into(),
),
// and the whole phrase.
FuzzyMatch::Exact(TokenMatch::new(&token, r#""badger badger" mushroom snake"#)),
],
token
.match_input(r#" "badger badger" mushroom snake "#, &app_meta)
.collect::<Vec<_>>()
.await,
);