ensure tag replacements fully match
https://anki.tenderapp.com/discussions/private/5180-anki-desktop-bug-removing-a-tag-removes-all-substrings
This commit is contained in:
parent
529deff82a
commit
8a9a9591cb
@ -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::<Result<Vec<Regex>>>()?;
|
||||
|
Loading…
Reference in New Issue
Block a user