# How to change this regexp to multiline?

**URL:** <https://forum.ansible.com/t/how-to-change-this-regexp-to-multiline/25566>\
**Category:** Ansible Project\
**Created:** [September 21, 2017, 7:51pm UTC](https://forum.ansible.com/t/how-to-change-this-regexp-to-multiline/25566 "2017-09-21T19:51:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [September 21, 2017, 7:51pm UTC](https://forum.ansible.com/t/how-to-change-this-regexp-to-multiline/25566/1 "2017-09-21T19:51:31Z")

</div>

I need to set the multiline flag on this, but don’t know how to. Can anyone help?

`regexp: '^(?:passwd):\s+(?:(?!sss).)+$'`

---

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [September 21, 2017, 8:01pm UTC](https://forum.ansible.com/t/how-to-change-this-regexp-to-multiline/25566/2 "2017-09-21T20:01:08Z")

</div>

Just a thought… I am using this with the replace module… does it already assume multiline (as lineinfile does not)?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [September 21, 2017, 8:07pm UTC](https://forum.ansible.com/t/how-to-change-this-regexp-to-multiline/25566/3 "2017-09-21T20:07:53Z")

</div>

Have you read the docs under regexp?  
[https://docs.ansible.com/ansible/latest/replace\_module.html](https://docs.ansible.com/ansible/latest/replace_module.html)

---

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [September 21, 2017, 8:10pm UTC](https://forum.ansible.com/t/how-to-change-this-regexp-to-multiline/25566/4 "2017-09-21T20:10:50Z")

</div>

I had seen the doc before, but I didn’t notice the definition under the regexp before. Thank you.
