Function human_regex::escape_all

source ·
pub fn escape_all<T>(options: &[T]) -> Vec<String> where
    T: Into<String> + Display,
Expand description

Escapes an entire list for use in something like an [or] or an [and] expression.

See the [cookbook] stop words example for an example of the utility of this function.

use human_regex::direct::escape_all;
let escaped_vec = escape_all(&vec!["et-al", "short-term", "full-scale"]);
assert_eq!(escaped_vec, vec![r"et\-al", r"short\-term", r"full\-scale"]);