Small changes

This commit is contained in:
ferdzo
2025-08-06 21:27:34 +02:00
parent 3acc9e9ebb
commit af8d26351d
6 changed files with 625 additions and 79 deletions

View File

@@ -23,3 +23,16 @@ func IsValidUrl(s string) bool {
return true
}
func IsValidShortUrl(s string) bool {
if len(s) < 3 || len(s) > 10 {
return false
}
shortUrlRegex := `^[a-zA-Z0-9]+$`
matched, err := regexp.MatchString(shortUrlRegex, s)
if err != nil || !matched {
return false
}
return true
}