On Mon, 21 Sep 2020 at 21:31, rajtheco...@gmail.com <rajthecomputer...@gmail.com> wrote: > > 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'
This list is for discussions about Ansible development. The Ansible Project mailing list would be the right forum for your question. See https://docs.ansible.com/ansible/latest/community/communication.html for details. The approach you are using works as expected in this test (caret included): ``` $ ansible localhost -m debug -a msg="{{ lines|map('regex_search', '^line con.*\n^\s(.*)', multiline=True)|select('string')|list }}" -e '{"lines":["foo\nbar","line console 0\n password","mine console 1\npassword","line console 2\nnospaceword","line console 3\n otherpassword"]}' localhost | SUCCESS => { "msg": [ "line console 0\n password", "line console 3\n otherpassword" ] } ``` Either the input data you're feeding it isn't what you expect, or your pattern doesn't match the correct input. -- Abhijit -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/CAA1Mq4W4ZSdZU2iKzL90JHOcYpzs4thq1%3DWEheZHpcAVbxCrLw%40mail.gmail.com.