6 type MatchOptions struct {
10 func pathExtractor(input string) [][][]byte {
11 surroundRegex := "[^][ \\t:'\"]*"
12 r := regexp.MustCompile("(" + surroundRegex + "[\\./]" + surroundRegex + ")")
14 temp = r.FindAllSubmatch([]byte(input), -1)
18 func stripParens(input string) string {
19 r := regexp.MustCompile("^\\((.*)\\)$")
21 temp = r.FindSubmatch([]byte(input))
25 return string(temp[1])
28 func postProcess(input string) string {
29 input = stripParens(input)
33 func GetAllMatches(input string, options MatchOptions) []string {
34 matches := [][][]byte{}
38 matches = pathExtractor(input)
39 for _, match := range matches {
41 if isEmail(s) || isDate(s) || isVersion(s) || isGitRange(s) || isGitInstruction(s) || endsWithInvalidString(s) || containsInvalidString(s) || len(s) <= 2 {
48 if options.format == "ackmate" {
49 s = fmt.Sprint(s, ":45")
51 result = append(result, s)