From 70132c8c4dc291193c368e3e42742b461c4d5bb8 Mon Sep 17 00:00:00 2001 From: Edgar HIPP Date: Sun, 30 Aug 2015 17:07:15 +0200 Subject: [PATCH] More matches (with _) --- extractor.go | 2 +- pe_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extractor.go b/extractor.go index 4dce18f..7cf69e4 100644 --- a/extractor.go +++ b/extractor.go @@ -9,7 +9,7 @@ type MatchOptions struct { } func pathExtractor(input string) [][][]byte { - surroundRegex := "[@~\\-a-zA-Z/.0-9]*" + 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 f0f013b..2deeae7 100644 --- a/pe_test.go +++ b/pe_test.go @@ -18,6 +18,11 @@ func TestEverything(t *testing.T) { t.Errorf("Doesn't match statement correctly", output) } + output = GetAllMatches("/usr_b/bin", MatchOptions{}) + if output[0] != "/usr_b/bin" { + t.Errorf("Doesn't match statement correctly", output) + } + output = GetAllMatches("\"/usr/bin", MatchOptions{}) if output[0] != "/usr/bin" { t.Errorf("Doesn't match statement correctly", output) -- 2.48.1