MustCreateRegex
Compiles a case-insensitive regular expression pattern for a given variable name, ensuring it matches the format {{.$varName}} or {{$varName}}.
def MustCreateRegex(
varName: string
) - > *regexp.Regexp
Builds a case-insensitive regular expression that matches a variable placeholder in the format {{ .$VARNAME }} or {{ $VARNAME }}. This function is used to create regex patterns for parsing template-like strings.
Parameters
| Name | Type | Description |
|---|---|---|
| varName | string | The name of the variable to be embedded in the regular expression. This name will be matched case-insensitively within the placeholder. |
Returns
| Type | Description |
|---|---|
*regexp.Regexp | A compiled regular expression object that can be used for matching. |