regexps

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const KeywordPattern = `[a-zA-Z0-9]+?[-'a-zA-Z0-9]*[a-zA-Z0-9]+?|[a-zA-Z0-9]+`

Variables

View Source
var (
	RxNonWord     = regexp.MustCompile(`[^a-zA-Z0-9]`)
	RxEmptySpace  = regexp.MustCompile(`\s+`)
	RxLanguageKey = regexp.MustCompile(`language:(\*|[a-z][-a-zA-Z]+)\s*`)
	RxKeyword     = regexp.MustCompile(`^(` + KeywordPattern + `)$`)
	RxKeywords    = regexp.MustCompile(`\b(` + KeywordPattern + `)\b`)
)
View Source
var (
	RxWord                   = regexp.MustCompile(`\w+`)
	RxQuoteStringsOnly       = regexp.MustCompile(`(?i)^(true|false|-?\d*[.,]?\d*)$`)
	RxParseHtmlTagKeyOnly    = regexp.MustCompile(`^([a-zA-Z][-a-zA-Z0-9]+)$`)
	RxParseHtmlTagKeyValue   = regexp.MustCompile(`^([a-zA-Z][-a-zA-Z0-9]+)=(.+?)$`)
	RxSplitHtmlTagAttributes = regexp.MustCompile(`\s+`)
	RxEmpty                  = regexp.MustCompile(`(?ms)\A\s*\z`)
	RxTmplTags               = regexp.MustCompile(`\{\{.+?}}`)
	RxHash10                 = regexp.MustCompile(`^\s*([a-fA-F0-9]{10})\s*$`)
	RxAtLeastSixDigits       = regexp.MustCompile(`^\s*([0-9]{6,})\s*$`)
)
View Source
var (
	RxKeySlice = regexp.MustCompile(`^([a-zA-Z][-_a-zA-Z0-9]+?[a-zA-Z0-9]*)\[(\d+)\]$`)
)

Functions

func Compile

func Compile(expr string) (rx *regexp.Regexp, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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