Skip to content

Commit

Permalink
Update regex.go
Browse files Browse the repository at this point in the history
  • Loading branch information
kavishgr committed Jul 22, 2023
1 parent 8824c53 commit 58e59f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ func SetRegex(ost, arch string) string{
switch {
// darwin amd64
case (ost == "darwin" && arch == "amd64"):
regex = `(?i)(?=.*(?:apple|darwin|macos|mac))(?=.*(?:amd64|x86_64))(?!.*(?:freebsd|netbsd|openbsd|linux|windows|win64|.sha256sum|.sha256|.sbom|checksums|.txt))(?:.*(?:apple|darwin|macos|mac).*?(?:amd64|x86_64)|(?:amd64|x86_64).*?(?:apple|darwin|macos|mac))(?:[^a-z]|$)`
regex = `(?i)(?=.*(?:apple|darwin|macos|mac))(?=.*(?:amd64|x86_64|x64))(?!.*(?:freebsd|netbsd|openbsd|linux|windows|win64|.sha256sum|.sha256|.sbom|checksums|.txt))(?:.*(?:apple|darwin|macos|mac).*?(?:amd64|x86_64|x64)|(?:amd64|x86_64|x64).*?(?:apple|darwin|macos|mac))(?:[^a-z]|$)`

// linux amd64
case (ost == "linux" && arch == "amd64"):
//good
regex = `(?i)(?=.*(?:linux))(?=.*(?:amd64|x86_64))(?!.*(?:freebsd|netbsd|openbsd|windows|win64|apple|darwin|macos|mac|.sha256sum|.sha256|.sbom|checksums|.txt|.rpm|.deb))(?:.*(?:linux).*?(?:amd64|x86_64)|(?:amd64|x86_64).*?(?:linux))(?:[^a-z]|$)`
regex = `(?i)(?=.*(?:linux))(?=.*(?:amd64|x86_64|x64))(?!.*(?:freebsd|netbsd|openbsd|windows|win64|apple|darwin|macos|mac|.sha256sum|.sha256|.sbom|checksums|.txt|.rpm|.deb))(?:.*(?:linux).*?(?:amd64|x86_64|x64)|(?:amd64|x86_64|x64).*?(?:linux))(?:[^a-z]|$)`

// darwin arm64
case (ost == "darwin" && arch == "arm64"):
Expand Down

0 comments on commit 58e59f1

Please sign in to comment.