# url requires slash at end regex\_replace filter

**URL:** <https://forum.ansible.com/t/url-requires-slash-at-end-regex-replace-filter/21621>\
**Category:** Ansible Project\
**Created:** [May 31, 2016, 10:40pm UTC](https://forum.ansible.com/t/url-requires-slash-at-end-regex-replace-filter/21621 "2016-05-31T22:40:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [May 31, 2016, 10:40pm UTC](https://forum.ansible.com/t/url-requires-slash-at-end-regex-replace-filter/21621/1 "2016-05-31T22:40:29Z")

</div>

I’m trying to create a template which contains a URL and must always have a / on the end. So if jenkins\_master\_url is ‘[https://xyz.com](https://xyz.com)’ ansible must add a /

If someone could help me with the regex\_replace I’d be most grateful:

{{ jenkins\_master\_url|regex\_replace(‘??’) }}

---

<div class="post-metadata">

**Author:** ![jorginator74](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jorginator74](https://forum.ansible.com/u/jorginator74)\
**Post date:** [June 1, 2016, 10:57am UTC](https://forum.ansible.com/t/url-requires-slash-at-end-regex-replace-filter/21621/2 "2016-06-01T10:57:08Z")

</div>

Hi
