Hello
I'am using the .keys function to get the key name out of a dict.
{{ item.keys() }}
which output:
["MyKeysName"]
Now, I'am trying to remove the *["* and *"]* so that only *MyKeysName *is
left.
I have been looking at the regex_replace filter but not being an expert at
regex I'am having trouble getting it to work.
Is regex_replace filter the best option here or is there another
recommended way?
Any tips on what the regex should look like?
[a-zA-Z]+ should allow me to extract only the characters leaving the [] and
" out correct?
{{ item.keys()|regex_replace('^[a-zA-Z]+$','\\1') }}
Running Ansible 2.2.0
Any help or guidance is appreciated.
Thanks
--
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/67c641b9-ef83-4580-ba04-179d7d6a9eec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.