Files
fn_registry/functions/cybersecurity/extract_urls.go
T
egutierrez bd9383fd82 feat: 16 funciones cybersecurity — análisis, crypto e IO de seguridad
12 funciones puras con implementación real:
HashSHA256, HashMD5, EntropyShannon, IsBase64, IsHex, ExtractURLs,
ParseIPCIDR, IPInRange, NormalizeURL, DetectSQLInjection,
LevenshteinDistance, JaccardSimilarity

4 funciones impuras con implementación real (stdlib):
LookupWhois, ResolveDNS, FetchHTTPHeaders, ScanPortTCP

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:23:41 +01:00

15 lines
352 B
Go

package cybersecurity
import "regexp"
var urlRegex = regexp.MustCompile(`https?://[^\s<>"'` + "`" + `\)\]\}]+`)
// ExtractURLs extrae todas las URLs (http/https) encontradas en el texto proporcionado.
func ExtractURLs(text string) []string {
matches := urlRegex.FindAllString(text, -1)
if matches == nil {
return []string{}
}
return matches
}