Skip to content

match_glob_ignore_case

Like match_glob, ignoring case: both sides are compared in Unicode lower case. A character that lower-cases to several (İ) counts as several for ?.

use helpers4::string::match_glob_ignore_case;

Cargo feature string (enabled by default). To compile only this module:

cargo add helpers4 --no-default-features --features string

or in Cargo.toml:

[dependencies]
helpers4 = { version = "0.0.11", default-features = false, features = ["string"] }
pub fn match_glob_ignore_case(pattern: &str, text: &str) -> bool
ParameterTypeDescription
pattern&strThe glob pattern.
text&strThe string to test.

bool — true if text matches pattern in full.

use helpers4::string::match_glob_ignore_case;

assert!(match_glob_ignore_case("screen *", "Screen 2"));
assert!(match_glob_ignore_case("É*", "école"));
assert!(!match_glob_ignore_case("screen *", "Home"));

src/string/match_glob_ignore_case.rs