validator

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Email is regexp pattern to validate emails
	Email = "" /* 1206-byte string literal not displayed */
	//WinPath is regexp pattern to validate window's file paths
	WinPath = `((\\\\)|([a-zA-Z]:\\))(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*`
	//UnixPath is regexp pattern to validate unix's file paths
	UnixPath = "(/[^/\x00]*)+/?"
)

Variables

This section is empty.

Functions

func FindNamedMatches

func FindNamedMatches(pattern *regexp.Regexp, str string) map[string]string

FindNamedMatches uses FindStringSubmatch to match and transform result into map

func IsEmail

func IsEmail(str string) bool

IsEmail check if the str is an email

func IsFilePath

func IsFilePath(str string) bool

IsFilePath check is a str is Win or Unix file

func IsMailTo

func IsMailTo(str string) (bool, map[string]string)

IsMailTo check if the str is an mailto format

func IsURL

func IsURL(str string) bool

IsURL check if the str is an URL

func IsUnixPath

func IsUnixPath(str string) bool

IsUnixPath check is a str is Unix file

func IsWinPath

func IsWinPath(str string) bool

IsWinPath check is a str is Win file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL