(input string)
| 388 | } |
| 389 | |
| 390 | func findHandleInstances(input string) []bridge.FacetParsing { |
| 391 | regex := regexp.MustCompile(`@([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?`) |
| 392 | matches := regex.FindAllStringIndex(input, -1) |
| 393 | results := []bridge.FacetParsing{} |
| 394 | for _, match := range matches { |
| 395 | results = append(results, bridge.FacetParsing{ |
| 396 | Start: match[0], |
| 397 | End: match[1], |
| 398 | Item: input[match[0]+1 : match[1]], // +1 to skip the '@' character |
| 399 | }) |
| 400 | } |
| 401 | return results |
| 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@%_\+~#//=])?)`) |
no outgoing calls
no test coverage detected