From 70e9a934af13f34aeaca0649f90d25524542136b Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Fri, 28 Apr 2023 17:13:30 -0400 Subject: [PATCH] Using correct regexp function I knew FindAll was too simple --- attachments.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attachments.go b/attachments.go index 6f96bbb..d58f9bd 100644 --- a/attachments.go +++ b/attachments.go @@ -142,8 +142,8 @@ func extractAttachments(post string, l *zap.Logger) ([]string, error) { return attachments, fmt.Errorf("error opening post to scan for attachment links: %q", err) } - for _, att := range pat.FindAll(postBody, -1) { - l.Info("found attachment", zap.String("filename", string(att))) + for _, att := range pat.FindAllSubmatch(postBody, -1) { + l.Info("found attachment", zap.String("filename", string(att[1]))) }