diff --git a/rslib/src/tags.rs b/rslib/src/tags.rs index abf3de3f2..f1ef9e306 100644 --- a/rslib/src/tags.rs +++ b/rslib/src/tags.rs @@ -135,7 +135,7 @@ impl Collection { let tags = split_tags(tags) .map(|tag| { let tag = if regex { tag.into() } else { text_to_re(tag) }; - Regex::new(&format!("(?i){}", tag)) + Regex::new(&format!("(?i)^{}$", tag)) .map_err(|_| AnkiError::invalid_input("invalid regex")) }) .collect::>>()?;