]> Sergey Matveev's repositories - path-extractor.git/blobdiff - extractor.go
Modularize project
[path-extractor.git] / extractor.go
index e05ad4b93b50730c149315f98b68ec5655ba9fa7..a17bf8a69cee0209dc03c37be21a073683c84dcc 100644 (file)
@@ -41,7 +41,7 @@ func GetAllMatches(input string, format string) []string {
                        continue
                }
 
-               if isEmail(candidatePath) || isDate(candidatePath) || isVersion(candidatePath) || isGitRange(candidatePath) || isGitInstruction(candidatePath) || endsWithInvalidString(candidatePath) || containsInvalidString(candidatePath) || len(candidatePath) <= 2 {
+               if isIp(candidatePath) || isEmail(candidatePath) || isDate(candidatePath) || isVersion(candidatePath) || isGitRange(candidatePath) || isGitInstruction(candidatePath) || startsWithInvalidString(candidatePath) || endsWithInvalidString(candidatePath) || containsInvalidString(candidatePath) || len(candidatePath) <= 2 || isSpace(candidatePath) {
                        continue
                }
                if isGitPath(candidatePath) {
@@ -59,7 +59,7 @@ func GetAllMatches(input string, format string) []string {
 }
 
 func getCursorPosition(input string) string {
-       r := regexp.MustCompile("^(:[0-9]+(:[0-9]+)?)$")
+       r := regexp.MustCompile("^(:[0-9]+(:[0-9]+)?)")
        temp := [][]byte{}
        temp = r.FindSubmatch([]byte(input))
        if len(temp) <= 1 {