Micro check library in Golang.
go get gopkg.in/alioygur/is.v1
It works with runes as long as is it possible.
Part of source code;
// Alpha check if the string contains only letters (a-zA-Z). Empty string is valid.
func Alpha(s string) bool {
for _, v := range s {
if ('Z' < v || v < 'A') && ('z' < v || v < 'a') {
return false
}
}
return true
}
package main
import "gopkg.in/alioygur/is.v1"
import "log"
func main() {
is.Email("jhon@example.com") // true
is.Numeric("Ⅸ") // false
is.UTFNumeric("Ⅸ") // true
}
for more documentation godoc
we are waiting your contribution
Many thanks to our contributors: contributors
I use code/got inspiration from these excellent libraries: