regex

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegexVariables = regexp.MustCompile(`(^|[^\\])(\{\{(?:\{[^{}]*\}|[^{}])*\}\})`)

	RegexEscpVariables = regexp.MustCompile(`\\\{\{(\{[^{}]*\}|[^{}])*\}\}`)

	// RegexReferences is the Regex for '$(...)' at the beginning of the string, and 'x$(...)' where 'x' is not '\'
	RegexReferences = regexp.MustCompile(`^\$\(.[^\ ]*\)|[^\\]\$\(.[^\ ]*\)`)

	// RegexEscpReferences is the Regex for '\$(...)'
	RegexEscpReferences = regexp.MustCompile(`\\\$\(.[^\ \)]*\)`)

	RegexVariableInit = regexp.MustCompile(`^\{\{(\{[^{}]*\}|[^{}])*\}\}`)

	RegexElementIndex = regexp.MustCompile(`{{\s*elementIndex\d*\s*}}`)

	RegexVariableKey = regexp.MustCompile(`\{{(.*?)\}}`)
)

Functions

func IsReference

func IsReference(value string) bool

IsReference returns true if the element contains a 'valid' reference $()

func IsVariable

func IsVariable(value string) bool

IsVariable returns true if the element contains a 'valid' variable {{}}

func ObjectHasVariables

func ObjectHasVariables(object interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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