(input string)
| 402 | } |
| 403 | |
| 404 | func findUrlInstances(input string) []bridge.FacetParsing { |
| 405 | regex := regexp.MustCompile(`[$|\W](https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*[-a-zA-Z0-9@%_\+~#//=])?)`) |
| 406 | matches := regex.FindAllStringIndex(input, -1) |
| 407 | results := []bridge.FacetParsing{} |
| 408 | for _, match := range matches { |
| 409 | results = append(results, bridge.FacetParsing{ |
| 410 | Start: match[0] + 1, |
| 411 | End: match[1], |
| 412 | Item: input[match[0]+1 : match[1]], |
| 413 | }) |
| 414 | } |
| 415 | return results |
| 416 | } |
| 417 | |
| 418 | func findTagInstances(input string) []bridge.FacetParsing { |
| 419 | regex := regexp.MustCompile(`#[a-zA-Z0-9_]+`) |
no outgoing calls
no test coverage detected