Hi Bob,
here my code I removed '^' still not working
- set_fact:
console: "{{ current_show_run[0] | map('regex_search', qry,
multiline=True | select('string') | list }}"
vars:
qry: '^line con.*\n\spassword'
On Monday, September 21, 2020 at 9:09:27 PM UTC+5:30 rhar...@umich.edu
On Mon, Sep 21, 2020 at 11:29 AM rajtheco...@gmail.com <
rajthecomputer...@gmail.com> wrote:
> How to search multiple lines using regex in Ansible?
>
> I tried below pattern and it is not working
>
> regex: ^line con.*(?:\n^\s.*)
>
> line console 0
> password
>
I don't think you can use caret "
How to search multiple lines using regex in Ansible?
I tried below pattern and it is not working
regex: ^line con.*(?:\n^\s.*)
line console 0
password
--
You received this message because you are subscribed to the Google Groups
"Ansible Development" group.
To unsubscribe from this group and