Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created January 4, 2016 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmsimard/cc762cd3f016270c83e7 to your computer and use it in GitHub Desktop.
Save dmsimard/cc762cd3f016270c83e7 to your computer and use it in GitHub Desktop.
key: 6bf597e0-8a98-478b-9a88-e9e389fdfd38
# Use regex_replace to return only the first 13 characters
# Equivalent to a command that'd be like:
# - echo $key |sed -e 's/^\(.\{13\}\).*/\1/'
# - echo $key |cut -c 1-13
- debug:
msg: "{{ key | regex_replace('^(.{13}).*', '\\1' }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment