Documentation
¶
Index ¶
Constants ¶
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)
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 ¶
var AbnormalApostrophes = `‘‛’`
AbnormalApostrophes string containing various abnormal apostrophes characters
var AbnormalCommas = `‚`
AbnormalCommas string containing various abnormal commas characters
var AbnormalQuotes = `‹›〈〉“”«»「」「」《》„‟〝〞`
AbnormalQuotes string containing various abnormal quote characters │ │
var CapitalizeAfter = []string{ Exclamation, At, Hash, And, BracketOpen, BracketClose, Underscore, Plus, Equal, SquareBracketOpen, SquareBracketClose, CurlyBracketOpen, CurlyBracketClose, Or, Slash, Backslash, Colon, Semicolon, Question, LesserThan, GreaterThan, Comma, Dot, Dash, }
CapitalizeAfter symbols that [ToTitle] needs to capitalize after Dash must be last because regexp.QuoteMeta doesn't escape dash
var CapitalizeAfterRegExp = regexp.MustCompile(`[` + regexp.QuoteMeta(CapitalizeAfterString) + `]`)
CapitalizeAfterRegExp regex that matches all the symbols after capitalization is necessary
var CapitalizeAfterString = strings.Join(CapitalizeAfter, "")
CapitalizeAfterString symbols that [ToTitle] needs to capitalize after (in string format)
var InvalidPathRegExp = regexp.MustCompile(`[^a-zA-Z0-9-_\s.]`)
InvalidPathRegExp regex for path string sanitization (matches everything except path allowed characters)
var NonAlphaNumericRegExp = regexp.MustCompile(`[^a-zA-Z0-9\s]+`)
NonAlphaNumericRegExp regex matching: non-alphanumeric ASCII characters, non-ASCII whitespace
var NonAlphaNumericWhiteSpaceRegExp = regexp.MustCompile(`[^a-zA-Z0-9]+`)
NonAlphaNumericWhiteSpaceRegExp regex matching: non-alphanumeric ASCII characters, ALL whitespace
var NonAsciiRegExp = regexp.MustCompile(`[^\x00-\x7F]+`)
NonAsciiRegExp regex matching: non-ASCII characters, non-ASCII whitespace
var NonAsciiSymbolsRegExp = regexp.MustCompile(`[^\x00-\x7F\p{L}\p{N}]+`)
NonAsciiSymbolsRegExp regex matching: non-ASCII symbols (ie. emojis, ligatures, misc symbols), non-ASCII whitespace
var NonAsciiSymbolsWhiteSpaceRegExp = regexp.MustCompile(`[^\x00-\x7F\p{L}\p{N}]+|\s+`)
NonAsciiSymbolsWhiteSpaceRegExp regex matching: non-ASCII symbols (ie. emojis, ligatures, misc symbols), ALL whitespace
var NonAsciiWhiteSpaceRegExp = regexp.MustCompile(`[^\x00-\x7F]+|\s+`)
NonAsciiWhiteSpaceRegExp regex matching: non-ASCII characters, ALL whitespace
var NullBytes = []byte("null")
NullBytes byte string representing JSON null value
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
var Symbols = []string{ Tick, Tilde, Exclamation, At, Hash, Dollar, Percent, Circumflex, And, Asterisk, BracketOpen, BracketClose, Underscore, Plus, Equal, SquareBracketOpen, SquareBracketClose, CurlyBracketOpen, CurlyBracketClose, Or, Slash, Backslash, Colon, Semicolon, Question, Apostrophe, LesserThan, GreaterThan, Comma, Dot, Dash, }
Symbols all symbols in slice format Dash must be last because regexp.QuoteMeta doesn't escape dash
var SymbolsRegExp = regexp.MustCompile(`[^\p{L}\p{N}\s]+`)
SymbolsRegExp regex matching: non-alphanumeric characters
var SymbolsWhiteSpaceRegExp = regexp.MustCompile(`[^\p{L}\p{N}]+`)
SymbolsWhiteSpaceRegExp regex matching: non-alphanumeric characters, ALL whitespace
var WhiteSpaceRegExp = regexp.MustCompile(`\s+`)
WhiteSpaceRegExp regex matching any whitespace
Functions ¶
This section is empty.
Types ¶
This section is empty.