Skip to content
Snippets Groups Projects
Commit 9b33a5c6 authored by Cornel Rautenbach's avatar Cornel Rautenbach
Browse files

IsAlphaNumericOrDash function

parent 60e21cd6
Branches
Tags v1.3.0
No related merge requests found
......@@ -76,6 +76,11 @@ func IsAlphaNumeric(str string) bool {
return regex.MatchString(str)
}
func IsAlphaNumericOrDash(str string) bool {
regex := regexp.MustCompile("^[a-zA-Z0-9-]*$")
return regex.MatchString(str)
}
func Equal(a string, b string) bool {
return strings.TrimSpace(strings.ToLower(a)) == strings.TrimSpace(strings.ToLower(b))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment