add regex support for `-eh` (#4437)

dev
Dogan Can Bakir 2023-11-28 18:09:39 +03:00 committed by GitHub
parent 578e301372
commit 7cd340b29a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import (
"fmt"
"io"
"os"
"regexp"
"strings"
"sync"
"time"
@ -437,7 +438,8 @@ func (i *Input) delItem(metaInput *contextargs.MetaInput) {
return err
}
if tmpUrl.Host == targetUrl.Host {
matched, _ := regexp.MatchString(metaInput.Input, tmpUrl.Host)
if tmpUrl.Host == targetUrl.Host || matched {
_ = i.hostMap.Del(tmpKey)
i.excludedHosts[tmpKey] = struct{}{}
i.excludedCount++