mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
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
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ impl Collection {
|
||||||
let tags = split_tags(tags)
|
let tags = split_tags(tags)
|
||||||
.map(|tag| {
|
.map(|tag| {
|
||||||
let tag = if regex { tag.into() } else { text_to_re(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"))
|
.map_err(|_| AnkiError::invalid_input("invalid regex"))
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<Regex>>>()?;
|
.collect::<Result<Vec<Regex>>>()?;
|
||||||
|
|
Loading…
Reference in a new issue