extractor.go | 2 +- pe_test.go | 10 ++++++++++ diff --git a/extractor.go b/extractor.go index 8e80d2c1378494bb1e05a8edb945e478573814fe..f64fe5fb1a5a0beb0b365c175050779d17137a80 100644 --- a/extractor.go +++ b/extractor.go @@ -9,7 +9,7 @@ format string } func pathExtractor(input string) [][][]byte { - surroundRegex := "[^]()!#[ \\t:'\"\\\\]*" + surroundRegex := "[^]\\^\\+()!#[ \\t:'\"\\\\]*" r := regexp.MustCompile("(" + surroundRegex + "[\\./]" + surroundRegex + ")") temp := [][][]byte{} temp = r.FindAllSubmatch([]byte(input), -1) diff --git a/pe_test.go b/pe_test.go index a2c563aabcc068f417ef299cdc5688a4f269b8f3..28f87f7afb3ddfb231e751b018861b1234057654 100644 --- a/pe_test.go +++ b/pe_test.go @@ -13,6 +13,16 @@ if len(output) != 0 { t.Errorf("Matches sentence", output) } + output = GetAllMatches("s/+//", MatchOptions{}) + if len(output) != 0 { + t.Errorf("Doesn't match substitute", output) + } + + output = GetAllMatches("s/^//", MatchOptions{}) + if len(output) != 0 { + t.Errorf("Doesn't match substitute", output) + } + output = GetAllMatches("/usr/bin/env\\", MatchOptions{}) if len(output) != 1 { t.Errorf("Doesn't match escaped", output)