Documentation ¶
Index ¶
- Constants
- func EmptyCheck(str ...string) bool
- func IsAlpha(strings ...string) bool
- func IsAlphaNumeric(strings ...string) bool
- func IsAlphaNumericWSpaces(strings ...string) bool
- func IsDigit(strings ...string) bool
- func IsEmail(strings ...string) bool
- func IsPhonenumber(strings ...string) bool
- func IsSlug(strings ...string) bool
- func IsValidLength(min, max int, str ...string) bool
- func IsValidRegex(regex string, strings ...string) bool
Constants ¶
View Source
const ( PhonenumberRegex = `^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$` EmailRegex = `^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$` DigitRegex = `^[0-9]+$` AlphaRegex = `^[a-zA-Z]+$` AlphaNumericRegex = `^[a-zA-Z0-9]+$` AlphaNumericSpaceRegex = `^[a-zA-Z0-9 ]+$` SlugRegex = `^[a-z0-9-]+$` )
Regex for validation.
Variables ¶
This section is empty.
Functions ¶
func IsAlphaNumeric ¶
Returns true if input is an alphanumeric string.
func IsAlphaNumericWSpaces ¶
Returns true if input is an alphanumeric string with spaces.
func IsPhonenumber ¶
Returns true if input is phonenumber.
func IsValidLength ¶
Returns true if valid. Returns false if length is less than min or greater than max.
func IsValidRegex ¶
Returns true if valid. Returns false if regex does not match for any of the strings.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.