7 type MatchOptions struct {
11 func pathExtractor(input string) [][][]byte {
12 surroundRegex := "[^]\\^\\+()!#[ \\t:'\"\\\\]*"
13 r := regexp.MustCompile("(" + surroundRegex + "[\\./]" + surroundRegex + ")")
15 temp = r.FindAllSubmatch([]byte(input), -1)
19 func stripParens(input string) string {
20 r := regexp.MustCompile("^\\((.*)\\)$")
22 temp = r.FindSubmatch([]byte(input))
26 return string(temp[1])
29 func postProcess(input string) string {
30 input = stripParens(input)
34 func GetAllMatches(input string, options MatchOptions) []string {
35 matches := [][][]byte{}
39 matches = pathExtractor(input)
40 for _, match := range matches {
42 if len(input) >= len(s+"(") && strings.Index(input, s+"(") != -1 {
46 if isEmail(s) || isDate(s) || isVersion(s) || isGitRange(s) || isGitInstruction(s) || endsWithInvalidString(s) || containsInvalidString(s) || len(s) <= 2 {
53 if options.format == "ackmate" {
54 s = fmt.Sprint(s, ":45")
56 result = append(result, s)