mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(wildcard): improve short word matching (#1806)
fix(wildcard): improve short word matching
This commit is contained in:
parent
1e76f33e47
commit
594393eaaf
2 changed files with 6 additions and 1 deletions
|
@ -41,7 +41,7 @@ func match(pattern, name string, simple bool) (matched bool) {
|
|||
return name == pattern
|
||||
|
||||
} else if idx == len(pattern)-1 && pattern[idx] == '*' { // egg*
|
||||
return strings.HasPrefix(name, pattern[:idx-1])
|
||||
return strings.HasPrefix(name, pattern[:idx])
|
||||
|
||||
// egg?bert*
|
||||
} else if wildEnd := pattern[len(pattern)-1] == '*'; !simple && ((wildEnd && strings.Count(pattern, "*") == 1) || (len(pattern) == len(name) && !strings.Contains(pattern, "*"))) { // egg?bert?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue