# get\_url and regex\_replace

**URL:** <https://forum.ansible.com/t/get-url-and-regex-replace/22755>\
**Category:** Ansible Project\
**Created:** [October 9, 2016, 11:28pm UTC](https://forum.ansible.com/t/get-url-and-regex-replace/22755 "2016-10-09T23:28:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpb3ll](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@cpb3ll](https://forum.ansible.com/u/cpb3ll)\
**Post date:** [October 9, 2016, 11:28pm UTC](https://forum.ansible.com/t/get-url-and-regex-replace/22755/1 "2016-10-09T23:28:25Z")

</div>

Hi All

I’m trying to use the get\_url module to download and rename at the same time. It does not work. Should it?

`

- name: Download  
get\_url:  
url: “{{ cfssl.download\_url }}/{{ item }}”  
dest: “{{ cfssl.install\_dir }}/{{ item | regex\_replace(‘^(._)\_(._)$’, ‘\1’) }}”  
mode: 0755  
with\_items:

- cfssl\_linux-amd64

- cfssljson\_linux-amd64

- name: print  
debug: msg=“{{ cfssl.install\_dir }}/{{ item | regex\_replace(‘^(._)\_(._)$’, ‘\1’) }}”  
with\_items:

- cfssl\_linux-amd64

- cfssljson\_linux-amd64

`

Thanks!

---

<div class="post-metadata">

**Author:** ![cpb3ll](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@cpb3ll](https://forum.ansible.com/u/cpb3ll)\
**Post date:** [October 11, 2016, 9:40pm UTC](https://forum.ansible.com/t/get-url-and-regex-replace/22755/2 "2016-10-11T21:40:28Z")

</div>

Ah, found it. Needed to double escape the underscore.

`

- name: Download  
get\_url:  
url: “{{ cfssl.download\_url }}/{{ item }}”  
dest: “{{ cfssl.install\_dir }}/{{ item | regex\_replace(‘^(._)\_(._)$’, ‘\1’) }}”  
mode: 0755  
with\_items:
- cfssl\_linux-amd64
- cfssljson\_linux-amd64

`

🙂
