From 9de1ccbbdc6802c0b0d5ab1b107be24a1a8f66d3 Mon Sep 17 00:00:00 2001 From: nyxgeek Date: Mon, 21 Oct 2024 19:35:42 -0500 Subject: [PATCH 1/2] added copyright search --- common/httpx/copyright.go | 87 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 common/httpx/copyright.go diff --git a/common/httpx/copyright.go b/common/httpx/copyright.go new file mode 100644 index 00000000..f647c3f7 --- /dev/null +++ b/common/httpx/copyright.go @@ -0,0 +1,87 @@ +package httpx + +import ( + "regexp" + "sort" + "strings" +) + +var crreYear = regexp.MustCompile(`(?:copyright|Copyright|COPYRIGHT|\(C\)|\(c\)|©|©|©)?\s*(?:[a-zA-Z0-9 ,-]+\s*)?[\s,]*(199[0-9]|20[0-1][0-9]|202[0-4])[\s,<-]+(?:copyright|Copyright|COPYRIGHT|\(C\)|\(c\)|©|©|©|199[0-9]|20[0-1][0-9]|202[0-4])?`) + + +func cleanText(text string) string { + text = strings.ReplaceAll(text, "", "") + text = strings.ReplaceAll(text, "", "") + text = strings.ReplaceAll(text, "\u00a0", " ") + text = strings.ReplaceAll(text, "©", "©") + text = strings.ReplaceAll(text, "–", "-") + text = strings.ReplaceAll(text, "-->", "") + text = strings.ReplaceAll(text, "