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!!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d22cd15-4b78-4824-9f9a-c884efe03d20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to