From: Diogo Franco (Kovensky) Date: Fri, 26 Jul 2013 05:14:10 +0000 (-0300) Subject: anidb: Correct the regexp used to verify ed2k hashes X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=c72425396c93c66187e359e43b90d52b1f25d746;p=go-anidb.git anidb: Correct the regexp used to verify ed2k hashes The POSIX character class isn't treated as a character class unless inside an extra set of brackets. --- diff --git a/filecache.go b/filecache.go index 5718e1d..564f84f 100644 --- a/filecache.go +++ b/filecache.go @@ -116,7 +116,7 @@ func (adb *AniDB) FileByID(fid FID) <-chan *File { return ch } -var validEd2kHash = regexp.MustCompile(`\A[:xdigit:]{32}\z`) +var validEd2kHash = regexp.MustCompile(`\A[[:xdigit:]]{32}\z`) // Retrieves a File by its Ed2kHash + Filesize combination. Uses the UDP API. func (adb *AniDB) FileByEd2kSize(ed2k string, size int64) <-chan *File {