mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
14 lines
335 B
Go
14 lines
335 B
Go
package variables
|
|
|
|
import "regexp"
|
|
|
|
//IsVariable returns true if the element contains a 'valid' variable {{}}
|
|
func IsVariable(element string) bool {
|
|
validRegex := regexp.MustCompile(variableRegex)
|
|
groups := validRegex.FindAllStringSubmatch(element, -1)
|
|
if len(groups) == 0 {
|
|
// there was no match
|
|
return false
|
|
}
|
|
return true
|
|
}
|