re

package
v0.0.0-...-3af07a4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NumberAlphaPattern                 = `(\d+)([A-Za-z]+)`
	ComposeDisallowedCharsPattern      = `[^a-z0-9_-]+`
	ComposeEnvVarPattern               = `\$\{([^}]+)\}`
	DiskKeyValuePattern                = `([A-Za-z0-9_]+)=("([^"\\]|\\.)*"|[^ \t]+)`
	ValidatorNamePattern               = `^[a-zA-Z\p{Han}]{1}[a-zA-Z0-9_\p{Han}]{0,30}$`
	ValidatorIPPattern                 = `^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$`
	DomainPattern                      = `^([\w\p{Han}\-\*]{1,100}\.){1,10}([\w\p{Han}\-]{1,24}|[\w\p{Han}\-]{1,24}\.[\w\p{Han}\-]{1,24})(:\d{1,5})?$`
	NginxServerNamePattern             = `^(?:\*|[\w\p{Han}-]{1,63})(?:\.(?:\*|[\w\p{Han}-]{1,63}))*$`
	ProxyCacheZonePattern              = `keys_zone=proxy_cache_zone_of_[\w.]+:(\d+)([kmgt]?)`
	ProxyCacheMaxSizePattern           = `max_size=([0-9.]+)([kmgt]?)`
	ProxyCacheMaxSizeValidationPattern = `max_size=\d+(\.\d+)?[kmgt]?`
	ProxyCacheInactivePattern          = `inactive=(\d+)([smhd])`
	NumberWordPattern                  = `^(\d+)(\w+)$`
	TrailingDigitsPattern              = `_(\d+)$`
	AlertIPPattern                     = `from\s+([0-9.]+)\s+port\s+(\d+)`
	CosDualStackPattern                = `.*cos-dualstack\..*`
	VersionPattern                     = `v(\d+\.\d+\.\d+)`
	PhpAssignmentPattern               = `^\s*([a-z_]+)\s*=\s*(.*)$`
	DurationWithOptionalUnitPattern    = `^(\d+)([smhdw]?)$`
	MysqlGroupPattern                  = `\[*\]`
	AnsiEscapePattern                  = "\x1b\\[[0-9;?]*[A-Za-z]|\x1b=|\x1b>"
	RecycleBinFilePattern              = `_1p_file_1p_(.+)_p_(\d+)_(\d+)`
)

Variables

This section is empty.

Functions

func GetRegex

func GetRegex(pattern string) *regexp.Regexp

GetRegex retrieves a compiled regex by its pattern string. Panics if the pattern is not found in the map.

func Init

func Init()

InitRegex compiles all regex patterns and stores them in the map. This function should be called once at program startup.

func RegisterRegex

func RegisterRegex(pattern string)

RegisterRegex registers a regex pattern and stores it in the map. This function should be called once at program startup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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