From 7506d22f2038de3e0352ece65362bb94e651be5e Mon Sep 17 00:00:00 2001 From: Edgar HIPP Date: Sun, 30 Aug 2015 17:07:14 +0200 Subject: [PATCH] Update tests and extractor --- extractor.go | 2 +- pe_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extractor.go b/extractor.go index 678f009..4dce18f 100644 --- a/extractor.go +++ b/extractor.go @@ -9,7 +9,7 @@ type MatchOptions struct { } 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 a9c1558..f0f013b 100644 --- a/pe_test.go +++ b/pe_test.go @@ -82,6 +82,11 @@ func TestEverything(t *testing.T) { 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) -- 2.44.0