]> Sergey Matveev's repositories - path-extractor.git/blobdiff - extractor.go
Check if path ends with '.', if yes, invalid path
[path-extractor.git] / extractor.go
index b7be986ea6b3ab8bca8582b0c8d6af4c7bb06d8e..d42bf0e0032767a5203c4f5ae72383dd0385436f 100644 (file)
@@ -1,4 +1,4 @@
-package main
+package pathextractor
 
 import "regexp"
 
@@ -10,14 +10,14 @@ func pathExtractor(input string) [][][]byte {
        return temp
 }
 
-func getAllMatches(input string) []string {
+func GetAllMatches(input string) []string {
        matches := [][][]byte{}
        result := []string{}
        s := string("")
        matches = pathExtractor(input)
        for _, match := range matches {
                s = string(match[1])
-               if isDate(s) || isVersion(s) || isGitRange(s) || isGitInstruction(s) || containsInvalidString(s) || len(s) <= 2 {
+               if isEmail(s) || isDate(s) || isVersion(s) || isGitRange(s) || isGitInstruction(s) || endsWithInvalidString(s) || containsInvalidString(s) || len(s) <= 2 {
                        continue
                }
                if isGitPath(s) {