extractor.go | 2 +- pe_test.go | 5 +++++ diff --git a/extractor.go b/extractor.go index 4dce18fbbb77923a2c2f77ca1b37c49821bb6730..7cf69e4b8dcbe76cd58105a0fe49ef573d13f917 100644 --- a/extractor.go +++ b/extractor.go @@ -9,7 +9,7 @@ format string } 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 f0f013bea2d9c69a9b8cc8b12cacef6ec9be97fb..2deeae75e91b5c61daf315ccba39ec9106ee0ba6 100644 --- a/pe_test.go +++ b/pe_test.go @@ -18,6 +18,11 @@ if output[0] != "/usr/bin" { 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)