I'm trying to replace all the dot characters in a helm template string with \., like so:
{{- regexReplaceAllLiteral "\." "https://endpoint.index.up" "\\\." -}}
I want this to output - https://endpoint\.index\.up
This is giving me a parse error. I've tried a bunch of different combinations but nothing is replacing the dot characters. Any help appreciated!
If you're just trying to replace a fixed string,
replacewill be easier to use. (This is one of the Sprig string functions so it will work with other tools that also embed the Sprig template extensions.)It doesn't look like backslash is treated specially in the replacement string argument to
regexReplaceAllLiteralso it should work so long as the replacement string argument isbackslash dot; inside the double-quoted string syntax you need to double the backslash but you do not need to escape the period, so again"\\."and not"\\\.".