Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(number float64) float64
- func Add(m, n interface{}) int
- func AddSlashes(str string) string
- func ArgStringToAryInterface(d []string) []interface{}
- func ArrayChunk(s []interface{}, size int) [][]interface{}
- func ArrayColumn(input map[string]map[string]interface{}, columnKey string) []interface{}
- func ArrayCombine(s1, s2 []interface{}) map[interface{}]interface{}
- func ArrayFill(startIndex int, num uint, value interface{}) map[int]interface{}
- func ArrayFlip(m map[interface{}]interface{}) map[interface{}]interface{}
- func ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
- func ArrayKeyPluck(data []map[string]string, value, key string) map[string]string
- func ArrayKeys(elements map[interface{}]interface{}) []interface{}
- func ArrayMerge(ss ...[]interface{}) []interface{}
- func ArrayMultiPluck(data []map[string]string, key string) map[string]map[string]string
- func ArrayPad(s []interface{}, size int, val interface{}) []interface{}
- func ArrayPluck(data []map[string]string, value string) []string
- func ArrayPop(s *[]interface{}) interface{}
- func ArrayPush(s *[]interface{}, elements ...interface{}) int
- func ArrayRand(elements []interface{}) []interface{}
- func ArrayRandMap(elements []map[string]string) []map[string]string
- func ArrayRemoveRepeatedElement(arr []string) (newArr []string)
- func ArrayReverse(s []interface{}) []interface{}
- func ArrayShift(s *[]interface{}) interface{}
- func ArraySlice(s []interface{}, offset, length uint) []interface{}
- func ArrayStringUniq(arr []string) (newArr []string)
- func ArrayUnshift(s *[]interface{}, elements ...interface{}) int
- func ArrayValues(elements map[interface{}]interface{}) []interface{}
- func AryInterfaceToArgString(d []interface{}) []string
- func AryMapInterfaceToAryMapString(d []map[string]interface{}) []map[string]string
- func AryMapStringToAryMapInterface(d []map[string]string) []map[string]interface{}
- func Base64Decode(str string) (string, error)
- func Base64Encode(str string) string
- func BaseConvert(number string, frombase, tobase int) (string, error)
- func BaseName(path string) string
- func Bin2hex(str string) (string, error)
- func BinDec(str string) (string, error)
- func ByteReplace(s, old, new []byte, n int) []byte
- func Ceil(value float64) float64
- func CheckDate(month, day, year int) bool
- func Chmod(filename string, mode os.FileMode) bool
- func Chown(filename string, uid, gid int) bool
- func Chr(ascii int) string
- func ChunkSplit(body string, chunklen uint, end string) string
- func ConvertBson(items bson.D, item bson.E) bson.D
- func Copy(source, dest string) (bool, error)
- func Crc32(str string) uint32
- func Date(format string, ts ...time.Time) string
- func DateTimeParse(st string) (int, error)
- func DateToJulian(year int, month time.Month, day int) (dayNo int)
- func Day(s string, e string) ([]string, []int64)
- func DecBin(number int64) string
- func Dechex(number int64) string
- func Decoct(number int64) string
- func Delete(filename string) error
- func Die(status int)
- func Divide(m, n interface{}) bool
- func Do(attempts int, sleep time.Duration, f func() error) error
- func DomainStatic(p, v string) string
- func Duration(str string) time.Duration
- func Echo(args ...interface{})
- func Empty(val interface{}) bool
- func Exec(command string, output *[]string, returnVar *int) string
- func Exit(status int)
- func Explode(delimiter, str string) []string
- func ExtractIP(addr string) (string, error)
- func FGetCsv(handle *os.File, length int, delimiter rune) ([][]string, error)
- func Fclose(handle *os.File) error
- func FileExists(filename string) bool
- func FileGetContents(filename string) (string, error)
- func FileMTime(filename string) (int64, error)
- func FilePutContents(filename string, data string, mode os.FileMode) error
- func FileSize(filename string) (int64, error)
- func Floor(value float64) float64
- func FormatDate(str interface{}) string
- func FormatDateTime(str interface{}) string
- func FormatDuring(t time.Time) string
- func FromYearWeek(year, month, day int) (wyear, week int)
- func FunctionName(i interface{}) string
- func GetAppRootPath() string
- func GetCurrentDirectory() string
- func GetCwd() (string, error)
- func GetHostByAddr(ipAddress string) (string, error)
- func GetHostByName(hostname string) (string, error)
- func GetHostByNameL(hostname string) ([]string, error)
- func GetHostName() (string, error)
- func GetHourDiffer(startTime, endTime interface{}) int64
- func GetMissingElement(arr []int) int
- func GetParentDirectory(dir string) string
- func Getenv(varname string) string
- func Glob(pattern string) ([]string, error)
- func HTMLEntityDecode(str string) string
- func HTTPBuildQuery(queryData url.Values) string
- func Hex2bin(data string) (string, error)
- func Hexdec(str string) (int64, error)
- func Hour(s string, e string) ([]string, []int64)
- func HtmlEntities(str string) string
- func IP2long(ipAddress string) uint32
- func ISOWeekday(year int, month time.Month, day int) (weekday int)
- func Implode(glue string, pieces []string) string
- func InArray(needle interface{}, haystack interface{}) bool
- func InMultiArray(haystack interface{}, needle ...interface{}) bool
- func InterfaceToAryMapStringInterface(in interface{}) []map[string]interface{}
- func InterfaceToAryMapStringString(in interface{}) []map[string]string
- func InterfaceToString(data []interface{}) (s []string)
- func IsDir(filename string) (bool, error)
- func IsFile(filename string) bool
- func IsNan(val float64) bool
- func IsNumeric(val interface{}) bool
- func IsReadable(filename string) bool
- func IsWriteable(filename string) bool
- func JS(v string) template.JS
- func JSONDecode(data []byte, val interface{}) error
- func JSONEncode(val interface{}) ([]byte, error)
- func JSONString(obj interface{}) string
- func JulianToDate(dayNo int) (year int, month time.Month, day int)
- func LCFirst(str string) string
- func LTrim(str string, characterMask ...string) string
- func Levenshtein(str1, str2 string, costIns, costRep, costDel int) int
- func Long2ip(properAddress uint32) string
- func MapInterfaceToMapString(d map[string]interface{}) map[string]string
- func MapStringToMapInterface(d map[string]string) map[string]interface{}
- func MarshalHTML(v interface{}) template.HTML
- func MarshalJS(v interface{}) template.JS
- func Max(nums ...float64) float64
- func MbStrLen(str string) int
- func Md5(str string) string
- func Md5File(path string) (string, error)
- func MemoryGetPeakUsage(realUsage bool) uint64
- func MemoryGetUsage(realUsage bool) uint64
- func Min(nums ...float64) float64
- func Mkdir(filename string, mode os.FileMode) error
- func MkdirAll(filename string, mode os.FileMode) error
- func Month(d string) ([]string, []int64)
- func MonthDate(d string) (string, string)
- func MultiArray(haystack interface{}) bool
- func NewReplacer(endpoint string, values ...interface{}) string
- func NextMonthDate(d string) (string, string)
- func Nl2br(str string, isXhtml bool) string
- func Now() time.Time
- func NumberFormat(number float64, decimals uint, decPoint, thousandsSep string) string
- func Octdec(str string) (int64, error)
- func Ord(char string) int
- func Pack(order binary.ByteOrder, data interface{}) (string, error)
- func ParseStr(encodedString string, result map[string]interface{}) error
- func ParseURL(str string, component int) (map[string]string, error)
- func PassThru(command string, returnVar *int)
- func PathInfo(path string, options int) map[string]string
- func Pi() float64
- func Pipeline(str string) mongo.Pipeline
- func PrevMonthDate(d string) (string, string)
- func Putenv(setting string) error
- func QuoteMeta(str string) string
- func RTrim(str string, characterMask ...string) string
- func Rand(min, max int) int
- func Random() string
- func RandomBytes(length int) ([]byte, error)
- func RandomInt(min, max int) (int, error)
- func RawURLDecode(str string) (string, error)
- func RawURLEncode(str string) string
- func RealPath(path string) (string, error)
- func RegexpBtcAddresses(text string) []string
- func RegexpCreditCards(text string) []string
- func RegexpDate(text string) []string
- func RegexpEmails(text string) []string
- func RegexpGUIDs(text string) []string
- func RegexpGitRepos(text string) []string
- func RegexpHexColors(text string) []string
- func RegexpIBANs(text string) []string
- func RegexpIPs(text string) []string
- func RegexpIPv4s(text string) []string
- func RegexpIPv6s(text string) []string
- func RegexpISBN10s(text string) []string
- func RegexpISBN13s(text string) []string
- func RegexpLinks(text string) []string
- func RegexpMACAddresses(text string) []string
- func RegexpMCCreditCards(text string) []string
- func RegexpMD5Hexes(text string) []string
- func RegexpNotKnownPorts(text string) []string
- func RegexpPhones(text string) []string
- func RegexpPhonesWithExts(text string) []string
- func RegexpPoBoxes(text string) []string
- func RegexpPrices(text string) []string
- func RegexpSHA1Hexes(text string) []string
- func RegexpSHA256Hexes(text string) []string
- func RegexpSSNs(text string) []string
- func RegexpStreetAddresses(text string) []string
- func RegexpTime(text string) []string
- func RegexpVISACreditCards(text string) []string
- func RegexpZipCodes(text string) []string
- func Rename(oldname, newname string) error
- func Round(value float64, precision int) float64
- func Sha1(str string) string
- func Sha1File(path string) (string, error)
- func SimilarText(first, second string, percent *float64) int
- func Sleep(t int64)
- func Soundex(str string) string
- func SplitString(p, split string, space bool) string
- func StartDate(wyear, week int) (year int, month time.Month, day int)
- func Stat(filename string) (os.FileInfo, error)
- func Static(p, v string) string
- func StrIPos(haystack, needle string, offset int) int
- func StrLen(str string) int
- func StrPad(str1, str2 string, i int) string
- func StrPos(haystack, needle string, offset int) int
- func StrRIPos(haystack, needle string, offset int) int
- func StrRPos(haystack, needle string, offset int) int
- func StrRepeat(input string, multiplier int) string
- func StrReplace(search, replace, subject string, count int) string
- func StrRev(str string) string
- func StrShuffle(str string) string
- func StrStr(haystack string, needle string) string
- func StrToLower(str string) string
- func StrToTime(format, strtime string) (int64, error)
- func StrToUpper(str string) string
- func StrTr(haystack string, params ...interface{}) string
- func StrTrim(str string) string
- func StrWordCount(str string) []string
- func StringToBytes(s string) []byte
- func StripSlashes(str string) string
- func SubStr(str string, start uint, length int) string
- func System(command string, returnVar *int) string
- func Tag(i interface{}) string
- func Ternary(condition bool, trueVal, falseVal interface{}) interface{}
- func Time() int64
- func TimeZone() *time.Location
- func Timestamp() int64
- func ToWeekDay(t interface{}) string
- func Touch(filename string) (bool, error)
- func Trim(str string, characterMask ...string) string
- func UCWords(str string) string
- func UCfirst(str string) string
- func URLDecode(str string) (string, error)
- func URLEncode(str string) string
- func USleep(t int64)
- func UnescapeString(v interface{}) string
- func Uniqid(prefix string) string
- func UnixTimeFormatDate(str interface{}) string
- func Unlink(filename string) error
- func Unpack(order binary.ByteOrder, data string) (interface{}, error)
- func VerifyEmail(email string) bool
- func VerifyIPv4(address string) bool
- func VerifyIPv6(address string) bool
- func VerifyPhone(phone string) bool
- func VersionCompare(version1, version2, operator string) bool
- func WordWrap(str string, width uint, br string, cut bool) string
- func ZhCharToFirstPinyin(p string) string
- func ZhCharToPinyin(p string) string
- func ZipOpen(filename string) (*zip.ReadCloser, error)
Constants ¶
const ( DatePattern = `` /* 461-byte string literal not displayed */ TimePattern = `(?i)\d{1,2}:\d{2} ?(?:[ap]\.?m\.?)?|\d[ap]\.?m\.?` PhonePattern = `` /* 133-byte string literal not displayed */ PhonesWithExtsPattern = `` /* 273-byte string literal not displayed */ LinkPattern = `` /* 176-byte string literal not displayed */ EmailPattern = `(?i)([A-Za-z0-9!#$%&'*+\/=?^_{|.}~-]+@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)` IPv4Pattern = `(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)` IPv6Pattern = `` /* 1224-byte string literal not displayed */ IPPattern = IPv4Pattern + `|` + IPv6Pattern NotKnownPortPattern = `6[0-5]{2}[0-3][0-5]|[1-5][\d]{4}|[2-9][\d]{3}|1[1-9][\d]{2}|10[3-9][\d]|102[4-9]` PricePattern = `[$]\s?[+-]?[0-9]{1,3}(?:(?:,?[0-9]{3}))*(?:\.[0-9]{1,2})?` HexColorPattern = `(?:#?([0-9a-fA-F]{6}|[0-9a-fA-F]{3}))` CreditCardPattern = `(?:(?:(?:\d{4}[- ]?){3}\d{4}|\d{15,16}))` VISACreditCardPattern = `4\d{3}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}` MCCreditCardPattern = `5[1-5]\d{2}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}` BtcAddressPattern = `[13][a-km-zA-HJ-NP-Z1-9]{25,34}` StreetAddressPattern = `` /* 149-byte string literal not displayed */ ZipCodePattern = `\b\d{5}(?:[-\s]\d{4})?\b` PoBoxPattern = `(?i)P\.? ?O\.? Box \d+` SSNPattern = `(?:\d{3}-\d{2}-\d{4})` MD5HexPattern = `[0-9a-fA-F]{32}` SHA1HexPattern = `[0-9a-fA-F]{40}` SHA256HexPattern = `[0-9a-fA-F]{64}` GUIDPattern = `[0-9a-fA-F]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}` ISBN13Pattern = `(?:[\d]-?){12}[\dxX]` ISBN10Pattern = `(?:[\d]-?){9}[\dxX]` MACAddressPattern = `(([a-fA-F0-9]{2}[:-]){5}([a-fA-F0-9]{2}))` IBANPattern = `[A-Z]{2}\d{2}[A-Z0-9]{4}\d{7}([A-Z\d]?){0,16}` GitRepoPattern = `((git|ssh|http(s)?)|(git@[\w\.]+))(:(\/\/)?)([\w\.@\:/\-~]+)(\.git)(\/)?` )
Regular expression patterns
Variables ¶
var ( DateRegex = regexp.MustCompile(DatePattern) TimeRegex = regexp.MustCompile(TimePattern) PhoneRegex = regexp.MustCompile(PhonePattern) PhonesWithExtsRegex = regexp.MustCompile(PhonesWithExtsPattern) LinkRegex = regexp.MustCompile(LinkPattern) EmailRegex = regexp.MustCompile(EmailPattern) IPv4Regex = regexp.MustCompile(IPv4Pattern) IPv6Regex = regexp.MustCompile(IPv6Pattern) IPRegex = regexp.MustCompile(IPPattern) NotKnownPortRegex = regexp.MustCompile(NotKnownPortPattern) PriceRegex = regexp.MustCompile(PricePattern) HexColorRegex = regexp.MustCompile(HexColorPattern) CreditCardRegex = regexp.MustCompile(CreditCardPattern) BtcAddressRegex = regexp.MustCompile(BtcAddressPattern) StreetAddressRegex = regexp.MustCompile(StreetAddressPattern) ZipCodeRegex = regexp.MustCompile(ZipCodePattern) PoBoxRegex = regexp.MustCompile(PoBoxPattern) SSNRegex = regexp.MustCompile(SSNPattern) MD5HexRegex = regexp.MustCompile(MD5HexPattern) SHA1HexRegex = regexp.MustCompile(SHA1HexPattern) SHA256HexRegex = regexp.MustCompile(SHA256HexPattern) GUIDRegex = regexp.MustCompile(GUIDPattern) ISBN13Regex = regexp.MustCompile(ISBN13Pattern) ISBN10Regex = regexp.MustCompile(ISBN10Pattern) VISACreditCardRegex = regexp.MustCompile(VISACreditCardPattern) MCCreditCardRegex = regexp.MustCompile(MCCreditCardPattern) MACAddressRegex = regexp.MustCompile(MACAddressPattern) IBANRegex = regexp.MustCompile(IBANPattern) GitRepoRegex = regexp.MustCompile(GitRepoPattern) )
Compiled regular expressions
Functions ¶
func AddSlashes ¶ added in v3.1.4
AddSlashes Addslashes addslashes()
func ArgStringToAryInterface ¶
func ArgStringToAryInterface(d []string) []interface{}
ArgStringToAryInterface ...
func ArrayChunk ¶
func ArrayChunk(s []interface{}, size int) [][]interface{}
ArrayChunk array_chunk()
func ArrayColumn ¶
ArrayColumn array_column()
func ArrayCombine ¶
func ArrayCombine(s1, s2 []interface{}) map[interface{}]interface{}
ArrayCombine array_combine()
func ArrayFlip ¶
func ArrayFlip(m map[interface{}]interface{}) map[interface{}]interface{}
ArrayFlip array_flip()
func ArrayKeyExists ¶
func ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
ArrayKeyExists array_key_exists()
func ArrayKeyPluck ¶
ArrayKeyPluck ...
func ArrayKeys ¶
func ArrayKeys(elements map[interface{}]interface{}) []interface{}
ArrayKeys array_keys()
func ArrayMultiPluck ¶
ArrayMultiPluck ...
func ArrayPad ¶
func ArrayPad(s []interface{}, size int, val interface{}) []interface{}
ArrayPad array_pad()
func ArrayPop ¶
func ArrayPop(s *[]interface{}) interface{}
ArrayPop array_pop() Pop the element off the end of slice
func ArrayPush ¶
func ArrayPush(s *[]interface{}, elements ...interface{}) int
ArrayPush array_push() Push one or more elements onto the end of slice
func ArrayRandMap ¶
ArrayRandMap 随即
func ArrayRemoveRepeatedElement ¶
ArrayRemoveRepeatedElement 数组去重
func ArrayShift ¶
func ArrayShift(s *[]interface{}) interface{}
ArrayShift array_shift() Shift an element off the beginning of slice
func ArraySlice ¶
func ArraySlice(s []interface{}, offset, length uint) []interface{}
ArraySlice array_slice()
func ArrayUnshift ¶
func ArrayUnshift(s *[]interface{}, elements ...interface{}) int
ArrayUnshift array_unshift() Prepend one or more elements to the beginning of a slice
func ArrayValues ¶
func ArrayValues(elements map[interface{}]interface{}) []interface{}
ArrayValues array_values()
func AryInterfaceToArgString ¶
func AryInterfaceToArgString(d []interface{}) []string
AryInterfaceToArgString ...
func AryMapInterfaceToAryMapString ¶
AryMapInterfaceToAryMapString ...
func AryMapStringToAryMapInterface ¶
AryMapStringToAryMapInterface ...
func BaseConvert ¶
BaseConvert base_convert()
func ChunkSplit ¶
ChunkSplit chunk_split()
func DateToJulian ¶
DateToJulian converts a date to a Julian day number.
func Exec ¶
Exec exec() returnVar, 0: succ; 1: fail Return the last line from the result of the command. command format eg:
"ls -a" "/bin/bash -c \"ls -a\""
func FileGetContents ¶
FileGetContents file_get_contents()
func FilePutContents ¶
FilePutContents file_put_contents()
func GetHostByAddr ¶ added in v3.1.4
GetHostByAddr Gethostbyaddr gethostbyaddr() Get the Internet host name corresponding to a given IP address
func GetHostByName ¶ added in v3.1.4
GetHostByName Gethostbyname gethostbyname() Get the IPv4 address corresponding to a given Internet host name
func GetHostByNameL ¶ added in v3.1.4
GetHostByNameL Gethostbynamel gethostbynamel() Get a list of IPv4 addresses corresponding to a given Internet host name
func GetHostName ¶ added in v3.1.4
GetHostName Gethostname gethostname()
func HTMLEntityDecode ¶
HTMLEntityDecode html_entity_decode()
func HTTPBuildQuery ¶
HTTPBuildQuery http_build_query()
func HtmlEntities ¶ added in v3.1.4
HtmlEntities Htmlentities htmlentities()
func ISOWeekday ¶
ISOWeekday returns the ISO 8601 weekday number of given day. (1 = Mon, 2 = Tue,.. 7 = Sun)
This is different from Go's standard time.Weekday.
func InArray ¶
func InArray(needle interface{}, haystack interface{}) bool
InArray in_array() haystack supported types: slice, array or map
func InMultiArray ¶
func InMultiArray(haystack interface{}, needle ...interface{}) bool
InMultiArray in_array() haystack supported types: slice, array or map
func InterfaceToAryMapStringInterface ¶
func InterfaceToAryMapStringInterface(in interface{}) []map[string]interface{}
InterfaceToAryMapStringInterface ...
func InterfaceToAryMapStringString ¶
InterfaceToAryMapStringString ...
func InterfaceToString ¶
func InterfaceToString(data []interface{}) (s []string)
InterfaceToString ...
func IsNumeric ¶
func IsNumeric(val interface{}) bool
IsNumeric is_numeric() Numeric strings consist of optional sign, any number of digits, optional decimal part and optional exponential part. Thus +0123.45e6 is a valid numeric value. In PHP hexadecimal (e.g. 0xf4c3b00c) is not supported, but IsNumeric is supported.
func JulianToDate ¶
JulianToDate converts a Julian day number to a date.
func Levenshtein ¶
Levenshtein levenshtein() costIns: Defines the cost of insertion. costRep: Defines the cost of replacement. costDel: Defines the cost of deletion.
func MapInterfaceToMapString ¶
MapInterfaceToMapString ...
func MapStringToMapInterface ¶
MapStringToMapInterface ...
func MemoryGetPeakUsage ¶ added in v3.1.4
MemoryGetPeakUsage memory_get_peak_usage() return in bytes
func MemoryGetUsage ¶
MemoryGetUsage memory_get_usage() return in bytes
func NextMonthDate ¶
NextMonthDate 获取当前日期的下个月的第一天和最后一天
func NumberFormat ¶
NumberFormat number_format() decimals: Sets the number of decimal points. decPoint: Sets the separator for the decimal point. thousandsSep: Sets the thousands' separator.
func ParseStr ¶
ParseStr parse_str() f1=m&f2=n -> map[f1:m f2:n] f[a]=m&f[b]=n -> map[f:map[a:m b:n]] f[a][a]=m&f[a][b]=n -> map[f:map[a:map[a:m b:n]]] f[]=m&f[]=n -> map[f:[m n]] f[a][]=m&f[a][]=n -> map[f:map[a:[m n]]] f[][]=m&f[][]=n -> map[f:[map[]]] // Currently does not support nested slice. f=m&f[a]=n -> error // This is not the same as PHP. a .[[b=c -> map[a___[b:c]
func ParseURL ¶
ParseURL parse_url() Parse a URL and return its components -1: all; 1: scheme; 2: host; 4: port; 8: user; 16: pass; 32: path; 64: query; 128: fragment
func PathInfo ¶ added in v3.1.4
PathInfo Pathinfo pathinfo() -1: all; 1: dirname; 2: basename; 4: extension; 8: filename Usage: Pathinfo("/home/go/path/src/php2go/php2go.go", 1|2|4|8)
func PrevMonthDate ¶
PrevMonthDate NextMonthDate 获取当前日期的上个月的第一天和最后一天
func RandomBytes ¶ added in v3.1.4
RandomBytes random_bytes()
func RawURLDecode ¶ added in v3.1.4
RawURLDecode Rawurldecode rawurldecode()
func RawURLEncode ¶ added in v3.1.4
RawURLEncode Rawurlencode rawurlencode()
func RegexpBtcAddresses ¶ added in v3.2.20
BtcAddresses finds all bitcoin addresses
func RegexpCreditCards ¶ added in v3.2.20
CreditCards finds all credit card numbers
func RegexpDate ¶ added in v3.2.20
Date finds all date strings
func RegexpEmails ¶ added in v3.2.20
Emails finds all email strings
func RegexpGUIDs ¶ added in v3.2.20
GUIDs finds all GUID strings
func RegexpGitRepos ¶ added in v3.2.20
GitRepos finds all git repository addresses which have protocol prefix
func RegexpHexColors ¶ added in v3.2.20
HexColors finds all hex color values
func RegexpIBANs ¶ added in v3.2.20
IBANs finds all IBAN strings
func RegexpIPv4s ¶ added in v3.2.20
IPv4s finds all IPv4 addresses
func RegexpIPv6s ¶ added in v3.2.20
IPv6s finds all IPv6 addresses
func RegexpISBN10s ¶ added in v3.2.20
ISBN10s finds all ISBN10 strings
func RegexpISBN13s ¶ added in v3.2.20
ISBN13s finds all ISBN13 strings
func RegexpLinks ¶ added in v3.2.20
Links finds all link strings
func RegexpMACAddresses ¶ added in v3.2.20
MACAddresses finds all MAC addresses
func RegexpMCCreditCards ¶ added in v3.2.20
MCCreditCards finds all MasterCard credit card numbers
func RegexpMD5Hexes ¶ added in v3.2.20
MD5Hexes finds all MD5 hex strings
func RegexpNotKnownPorts ¶ added in v3.2.20
NotKnownPorts finds all not-known port numbers
func RegexpPhones ¶ added in v3.2.20
Phones finds all phone numbers
func RegexpPhonesWithExts ¶ added in v3.2.20
PhonesWithExts finds all phone numbers with ext
func RegexpPoBoxes ¶ added in v3.2.20
PoBoxes finds all po-box strings
func RegexpPrices ¶ added in v3.2.20
Prices finds all price strings
func RegexpSHA1Hexes ¶ added in v3.2.20
SHA1Hexes finds all SHA1 hex strings
func RegexpSHA256Hexes ¶ added in v3.2.20
SHA256Hexes finds all SHA256 hex strings
func RegexpStreetAddresses ¶ added in v3.2.20
StreetAddresses finds all street addresses
func RegexpTime ¶ added in v3.2.20
Time finds all time strings
func RegexpVISACreditCards ¶ added in v3.2.20
VISACreditCards finds all VISA credit card numbers
func RegexpZipCodes ¶ added in v3.2.20
ZipCodes finds all zip codes
func SimilarText ¶
SimilarText similar_text()
func SplitString ¶
SplitString 分割字符串 p 字符串, split 分隔符 , space 是否需要保留文字中的空格
func StrReplace ¶
StrReplace str_replace()
func StrToTime ¶
StrToTime StrToTime() StrToTime("02/01/2006 15:04:05", "02/01/2016 15:04:05") == 1451747045 StrToTime("3 04 PM", "8 41 PM") == -62167144740
func StrTr ¶ added in v3.1.4
StrTr Strtr strtr()
If the parameter length is 1, type is: map[string]string Strtr("baab", map[string]string{"ab": "01"}) will return "ba01" If the parameter length is 2, type is: string, string Strtr("baab", "ab", "01") will return "1001", a => 0; b => 1.
func StringToBytes ¶ added in v3.2.31
func StripSlashes ¶ added in v3.1.4
StripSlashes Stripslashes stripslashes()
func System ¶
System system() returnVar, 0: succ; 1: fail Returns the last line of the command output on success, and "" on failure.
func Ternary ¶
func Ternary(condition bool, trueVal, falseVal interface{}) interface{}
Ternary Ternary expression max := Ternary(a > b, a, b).(int)
func VersionCompare ¶
VersionCompare version_compare() The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. special version strings these are handled in the following order, (any string not found) < dev < alpha = a < beta = b < RC = rc < # < pl = p Usage: VersionCompare("1.2.3-alpha", "1.2.3RC7", '>=') VersionCompare("1.2.3-beta", "1.2.3pl", 'lt') VersionCompare("1.1_dev", "1.2any", 'eq')
Types ¶
This section is empty.