Hello,
I’m having trouble parsing a string.
The situation:
- parameters:
full: [‘hostname1:abcdefg1’,‘hostname2:-vip2’,‘hostname3:abc-vip3’]
It is required of me to have a parameter/list of hostnames without the rest of the string
i.e
just_hostnames: [‘hostname1’,‘hostname2’,‘hostname3’]
I tried using using regex_replace like this
just_hostnames: “{{ full | regex_replace(‘:(?(?!’))*', ‘’) }}”
But i got the error -
template error while templating string expected token ‘end of print statement’, got ‘.’.
If you need further information about the usecase please ask!
Thank you very much!!