.gitignore | 1 + pe_test.go | 5 +++++ validators.go | 2 +- diff --git a/.gitignore b/.gitignore index 3f008b903ed66583bde37615fbaafd027897feee..7097f7f63a98ee07abc216b5fc7bceb4d7f86beb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ pe *.txt demo.gif +path-extractor diff --git a/pe_test.go b/pe_test.go index 6545029a9c379c20334858f8ae1dafb506c23793..cc8ef4d98ffa172a79e2e247fa28c5fb4b8f901c 100644 --- a/pe_test.go +++ b/pe_test.go @@ -18,6 +18,11 @@ if len(output) != 0 { t.Errorf("Matches email adresses", output[0]) } + output = GetAllMatches("and/or") + if len(output) != 0 { + t.Errorf("Matches and/or adresses", output[0]) + } + output = GetAllMatches("v1.2") if len(output) != 0 { t.Errorf("Matches version number", output[0]) diff --git a/validators.go b/validators.go index cd9477dc64acd28b5cfde017ecb25ef3ec6af713..cb09c4035ccb8b00c72bfce3e53a8f7e759e3525 100644 --- a/validators.go +++ b/validators.go @@ -38,7 +38,7 @@ return r.Match([]byte(input)) } func containsInvalidString(input string) bool { - invalidStrings := []string{"(", ")", "@", "origin/", "{", "}", "<", ">", "$", "*"} + invalidStrings := []string{"(", ")", "@", "and/or", "origin/", "{", "}", "<", ">", "$", "*"} for _, s := range invalidStrings { if strings.Contains(input, s) { return true