Closed tcurdt closed 4 years ago
The API is a Go regexp, so its methods already allow you to obtain the matching offsets, for example. The xurls command-line tool uses them if you want an example.
Ahhh, thanks for the quick reply. I didn't realize that from the README.
Neither this
rxStrict.FindAllString("must have scheme: http://foo.com/.", -1) // []string{"http://foo.com/"}
nor Note that the funcs compile regexes, so avoid calling them repeatedly
were clear on this.
Thanks for the suggestion! I've just pushed 8d3a99a85f5f22008b2fa1c5bf3521107631413f to be a bit clearer.
Finding the links and then searching for them to replace them feels rather inefficient.
It would be great if the API would also allow for link replacements. Or just return position information (start, stop/len) of the urls being found.