# a Ansible regex\_replace filter to extract the first part of the string with double quote at beginning.

**URL:** <https://forum.ansible.com/t/a-ansible-regex-replace-filter-to-extract-the-first-part-of-the-string-with-double-quote-at-beginning/35051>\
**Category:** Ansible Project\
**Created:** [April 26, 2021, 1:28am UTC](https://forum.ansible.com/t/a-ansible-regex-replace-filter-to-extract-the-first-part-of-the-string-with-double-quote-at-beginning/35051 "2021-04-26T01:28:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vkky2k](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vkky2k](https://forum.ansible.com/u/vkky2k)\
**Post date:** [April 26, 2021, 1:28am UTC](https://forum.ansible.com/t/a-ansible-regex-replace-filter-to-extract-the-first-part-of-the-string-with-double-quote-at-beginning/35051/1 "2021-04-26T01:28:47Z")

</div>

My intention is to match and replace a string with its first part. The string would be started with double quote, and it’s format would be like this: some-string = _ **“ORACLE\_logs:vserve-test-1”: {** _

So, if my statement is: vol\_name: “{{ some-string|regex\_replace(??? }}”, then the filter will assign “ORACLE\_logs” to vol\_name.

Thanks!
