extractor.go | 2 +- pe_test.go | 5 +++++ diff --git a/extractor.go b/extractor.go index 678f009e50a5b7c92375f0924744625036efac20..4dce18fbbb77923a2c2f77ca1b37c49821bb6730 100644 --- a/extractor.go +++ b/extractor.go @@ -9,7 +9,7 @@ format string } func pathExtractor(input string) [][][]byte { - surroundRegex := "[@~a-zA-Z/.]*" + surroundRegex := "[@~\\-a-zA-Z/.0-9]*" r := regexp.MustCompile("(" + surroundRegex + "[\\./]" + surroundRegex + ")") temp := [][][]byte{} temp = r.FindAllSubmatch([]byte(input), -1) diff --git a/pe_test.go b/pe_test.go index a9c15589ce9d89c5ae70ca007233509b274ea377..f0f013bea2d9c69a9b8cc8b12cacef6ec9be97fb 100644 --- a/pe_test.go +++ b/pe_test.go @@ -82,6 +82,11 @@ if len(output) != 0 { t.Errorf("Matches this.user", output) } + output = GetAllMatches("To https://test@test.org/88/ls.git", MatchOptions{}) + if len(output) != 0 { + t.Errorf("Matches email adresses", output) + } + output = GetAllMatches(" mail@mail.com ", MatchOptions{}) if len(output) != 0 { t.Errorf("Matches email adresses", output)