symbols

package
v1.0.75 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	QuoteByte              byte = '"'
	TickByte               byte = '`'
	TildeByte              byte = '~'
	ExclamationByte        byte = '!'
	AtByte                 byte = '@'
	HashByte               byte = '#'
	DollarByte             byte = '$'
	PercentByte            byte = '%'
	CircumflexByte         byte = '^'
	AndByte                byte = '&'
	AsteriskByte           byte = '*'
	BracketOpenByte        byte = '('
	BracketCloseByte       byte = ')'
	DashByte               byte = '-'
	UnderscoreByte         byte = '_'
	PlusByte               byte = '+'
	EqualByte              byte = '='
	SquareBracketOpenByte  byte = '['
	SquareBracketCloseByte byte = ']'
	CurlyBracketOpenByte   byte = '{'
	CurlyBracketCloseByte  byte = '}'
	OrByte                 byte = '|'
	SlashByte              byte = '/'
	BackslashByte          byte = '\\'
	ColonByte              byte = ':'
	SemicolonByte          byte = ';'
	QuestionByte           byte = '?'
	ApostropheByte         byte = '\''
	LesserThanByte         byte = '<'
	GreaterThanByte        byte = '>'
	CommaByte              byte = ','
	DotByte                byte = '.'
	SpaceByte              byte = ' '
	TabByte                byte = '\t'
	NewLineByte            byte = '\n'
)

Symbols ASCII special symbols (Byte)

View Source
const (
	Null               string = "null"
	Quote              string = `"`
	Tick               string = "`"
	Tilde              string = `~`
	Exclamation        string = `!`
	At                 string = `@`
	Hash               string = `#`
	Dollar             string = `$`
	Percent            string = `%`
	Circumflex         string = `^`
	And                string = `&`
	Asterisk           string = `*`
	BracketOpen        string = `(`
	BracketClose       string = `)`
	Dash               string = `-`
	Underscore         string = `_`
	Plus               string = `+`
	Equal              string = `=`
	SquareBracketOpen  string = `[`
	SquareBracketClose string = `]`
	CurlyBracketOpen   string = `{`
	CurlyBracketClose  string = `}`
	Or                 string = `|`
	Slash              string = `/`
	Backslash          string = `\`
	Colon              string = `:`
	Semicolon          string = `;`
	Question           string = `?`
	Apostrophe         string = `'`
	LesserThan         string = `<`
	GreaterThan        string = `>`
	Comma              string = `,`
	Dot                string = `.`
	Space              string = ` `
	Tab                string = "\t"
	NewLine            string = "\n"
)

Symbols ASCII special symbols

Variables

View Source
var AbnormalApostrophes = `‘‛’`

AbnormalApostrophes string containing various abnormal apostrophes characters

View Source
var AbnormalCommas = `‚`

AbnormalCommas string containing various abnormal commas characters

View Source
var AbnormalQuotes = `‹›〈〉“”«»「」「」《》„‟〝〞`

AbnormalQuotes string containing various abnormal quote characters │ │

CapitalizeAfter symbols that [ToTitle] needs to capitalize after Dash must be last because regexp.QuoteMeta doesn't escape dash

View Source
var CapitalizeAfterRegExp = regexp.MustCompile(`[` + regexp.QuoteMeta(CapitalizeAfterString) + `]`)

CapitalizeAfterRegExp regex that matches all the symbols after capitalization is necessary

View Source
var CapitalizeAfterString = strings.Join(CapitalizeAfter, "")

CapitalizeAfterString symbols that [ToTitle] needs to capitalize after (in string format)

View Source
var InvalidPathRegExp = regexp.MustCompile(`[^a-zA-Z0-9-_\s.]`)

InvalidPathRegExp regex for path string sanitization (matches everything except path allowed characters)

View Source
var NonAlphaNumericRegExp = regexp.MustCompile(`[^a-zA-Z0-9\s]+`)

NonAlphaNumericRegExp regex matching: non-alphanumeric ASCII characters, non-ASCII whitespace

View Source
var NonAlphaNumericWhiteSpaceRegExp = regexp.MustCompile(`[^a-zA-Z0-9]+`)

NonAlphaNumericWhiteSpaceRegExp regex matching: non-alphanumeric ASCII characters, ALL whitespace

View Source
var NonAsciiRegExp = regexp.MustCompile(`[^\x00-\x7F]+`)

NonAsciiRegExp regex matching: non-ASCII characters, non-ASCII whitespace

View Source
var NonAsciiSymbolsRegExp = regexp.MustCompile(`[^\x00-\x7F\p{L}\p{N}]+`)

NonAsciiSymbolsRegExp regex matching: non-ASCII symbols (ie. emojis, ligatures, misc symbols), non-ASCII whitespace

View Source
var NonAsciiSymbolsWhiteSpaceRegExp = regexp.MustCompile(`[^\x00-\x7F\p{L}\p{N}]+|\s+`)

NonAsciiSymbolsWhiteSpaceRegExp regex matching: non-ASCII symbols (ie. emojis, ligatures, misc symbols), ALL whitespace

View Source
var NonAsciiWhiteSpaceRegExp = regexp.MustCompile(`[^\x00-\x7F]+|\s+`)

NonAsciiWhiteSpaceRegExp regex matching: non-ASCII characters, ALL whitespace

View Source
var NullBytes = []byte("null")

NullBytes byte string representing JSON null value

View Source
var RFC3339NanoRegExp = regexp.MustCompile(`^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?([+-](\d{2}):(\d{2})|Z)$`)

RFC3339NanoRegExp regex matching a timestamp in RFC3339Nano format

Symbols all symbols in slice format Dash must be last because regexp.QuoteMeta doesn't escape dash

View Source
var SymbolsRegExp = regexp.MustCompile(`[^\p{L}\p{N}\s]+`)

SymbolsRegExp regex matching: non-alphanumeric characters

View Source
var SymbolsWhiteSpaceRegExp = regexp.MustCompile(`[^\p{L}\p{N}]+`)

SymbolsWhiteSpaceRegExp regex matching: non-alphanumeric characters, ALL whitespace

View Source
var WhiteSpaceRegExp = regexp.MustCompile(`\s+`)

WhiteSpaceRegExp regex matching any whitespace

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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