Documentation ¶
Index ¶
- Constants
- Variables
- func BtcAddresses(text string) []string
- func CreditCards(text string) []string
- func Date(text string) []string
- func Emails(text string) []string
- func GUIDs(text string) []string
- func GitRepos(text string) []string
- func HexColors(text string) []string
- func IBANs(text string) []string
- func IPs(text string) []string
- func IPv4s(text string) []string
- func IPv6s(text string) []string
- func ISBN10s(text string) []string
- func ISBN13s(text string) []string
- func Links(text string) []string
- func MACAddresses(text string) []string
- func MCCreditCards(text string) []string
- func MD5Hexes(text string) []string
- func NotKnownPorts(text string) []string
- func Phones(text string) []string
- func PhonesWithExts(text string) []string
- func PoBoxes(text string) []string
- func Prices(text string) []string
- func SHA1Hexes(text string) []string
- func SHA256Hexes(text string) []string
- func SSNs(text string) []string
- func StreetAddresses(text string) []string
- func Time(text string) []string
- func VISACreditCards(text string) []string
- func ZipCodes(text string) []string
Constants ¶
View Source
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 ¶
View Source
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 BtcAddresses ¶
BtcAddresses finds all bitcoin addresses
func MCCreditCards ¶
MCCreditCards finds all MasterCard credit card numbers
func NotKnownPorts ¶
NotKnownPorts finds all not-known port numbers
func PhonesWithExts ¶
PhonesWithExts finds all phone numbers with ext
func StreetAddresses ¶
StreetAddresses finds all street addresses
func VISACreditCards ¶
VISACreditCards finds all VISA credit card numbers
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.