regexes

package
v0.0.0-...-9ab1851 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2018 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IDExpr             = `\d{17,19}`
	UserMentionExpr    = `<@!?(` + IDExpr + `)>`
	RoleMentionExpr    = `<@&(` + IDExpr + `)>`
	ChannelMentionExpr = `<#(` + IDExpr + `)>`
	EmojiExpr          = `^<(?P<animated>a?):(?P<name>[_a-zA-Z]{2,32}):(?P<id>` + IDExpr + `)>$`

	ID             = regexp.MustCompile(`^` + IDExpr + `$`)
	UserMention    = regexp.MustCompile(`^` + UserMentionExpr + `$`)
	RoleMention    = regexp.MustCompile(`^` + RoleMentionExpr + `$`)
	ChannelMention = regexp.MustCompile(`^` + ChannelMentionExpr + `$`)
	Emoji          = regexp.MustCompile(`^` + EmojiExpr + `$`)

	UserMentionOrID    = regexp.MustCompile(`^(?:` + UserMentionExpr + `)|^` + IDExpr + `$`)
	RoleMentionOrID    = regexp.MustCompile(`^(?:` + RoleMentionExpr + `)|^` + IDExpr + `$`)
	ChannelMentionOrID = regexp.MustCompile(`^(?:` + ChannelMentionExpr + `)|^` + IDExpr + `$`)
)

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