regexp

package
v0.0.0-...-ab145b9 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContainsNumber matches on any numbers
	ContainsNumber = regexp.MustCompile(`[0-9]+`)

	// DiscordInviteCodeRegexp matches a Discord Invite Code
	DiscordInviteCodeRegexp = regexp.MustCompile(
		`^[A-Za-z0-9-]+$`,
	)

	// DiscordInviteRegexp matches a linked Discord Invite
	DiscordInviteRegexp = regexp.MustCompile(
		`^(http(s)?:\/\/)?(discord\.gg(\/invite)?|discordapp\.com\/invite)\/([A-Za-z0-9-]+)(\/?)$`,
	)

	// EmojiRegex matches a built in Emoji or discord emoji
	EmojiRegex = regexp.MustCompile(`[\x{00A0}-\x{1F9EF}]|<(a)?:[^<>:]+:[0-9]+>`)

	UnicodeEmojiRegex = regexp.MustCompile(`[\x{00A0}-\x{1F9EF}]`)

	// DiscordEmojiRegexp matches an Emoji, or an Emoji ID
	DiscordEmojiRegexp = regexp.MustCompile(`(<(a)?:([^<>:]+):)?([0-9]+)>?`)

	DiscordEmojiStrictRegexp = regexp.MustCompile(`<a?:(\w+):(\d+)>`)

	SnowflakeRegexp = regexp.MustCompile(`^[0-9]+$`)

	DiscordMessageLinkRegexp = regexp.MustCompile(`https:\/\/discord(app)?.com\/channels\/(\d+)\/(\d+)\/(\d+)`)
)

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