2023-03-03 11:32:40 +00:00
|
|
|
package regex
|
|
|
|
|
|
|
|
import "regexp"
|
|
|
|
|
|
|
|
var (
|
2024-10-08 19:43:04 +00:00
|
|
|
// RegexVariables is the Regex for '{{...}}' at the beginning of the string, and 'x{{...}}' where 'x' is not '\'
|
2023-03-03 11:32:40 +00:00
|
|
|
RegexVariables = 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 '\$(...)'
|
2023-11-14 13:23:28 +00:00
|
|
|
RegexEscpReferences = regexp.MustCompile(`\\\$\(.[^\ \)]*\)`)
|
2023-03-03 11:32:40 +00:00
|
|
|
|
|
|
|
RegexVariableInit = regexp.MustCompile(`^\{\{(\{[^{}]*\}|[^{}])*\}\}`)
|
|
|
|
|
|
|
|
RegexElementIndex = regexp.MustCompile(`{{\s*elementIndex\d*\s*}}`)
|
|
|
|
)
|