mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
fix unanchored regex in bulk tag add routine
Previously, it was not possible to add a substring of an existing tag. For example, with the tag "foobar", you could not add the tag "foo", "bar" or "oob". Because the match was unanchored, the regex checking whether the tag already existed determined that the tag was present when it was not.
This commit is contained in:
parent
7cfeb6cbb3
commit
0614642052
1 changed files with 1 additions and 1 deletions
|
|
@ -152,7 +152,7 @@ impl Collection {
|
|||
let matcher = regex::RegexSet::new(
|
||||
tags.iter()
|
||||
.map(|s| regex::escape(s))
|
||||
.map(|s| format!("(?i){}", s)),
|
||||
.map(|s| format!("(?i)^{}$", s)),
|
||||
)
|
||||
.map_err(|_| AnkiError::invalid_input("invalid regex"))?;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue