Skip to content

Internet Functions

CIDRBlock

returns the CIDR block string of an IPv4 with the given number of bits

Syntax:

CIDRBlock(ip string, bits int) -> string

Examples:

CIDRBlock("192.168.42.1", 16) = "192.168.0.0/16"
CIDRBlock("10.72.244.8", 8) = "10.0.0.0/8"

EmailDomain

extracts the domain portion of the given email address

Syntax:

EmailDomain(email string) -> string

Examples:

EmailDomain("hello@scowl.dev") = "scowl.dev"
EmailDomain("not-an-email") is null

EmailHandle

extracts the handle portion of the given email address

Syntax:

EmailHandle(email string) -> string

Examples:

EmailHandle("hello@scowl.dev") = "hello"
EmailHandle("not-an-email") is null

IPCBlock

extracts the A-C portions of an IPv4 address: A.B.C.D -> A.B.C

Syntax:

IPCBlock(ip string) -> string

Examples:

IPCBlock("192.168.0.1") = "192.168.0"
IPCBlock("not-an-ip") is null

NormalizeEmail

normalizes an email address by removing portions that do not impact delivery. This includes removing dots from gmail addresses and + suffixes from all emails.

Syntax:

NormalizeEmail(email string) -> string

Examples:

NormalizeEmail("scowl.user@gmail.com") = "scowluser@gmail.com"
NormalizeEmail("hide.me+scowl@yahoo.com") = "hide.me@yahoo.com"
NormalizeEmail("h.e.l.l.o+suffix@gmail.com") = "hello@gmail.com"