Capture the stdout result in a variable, using regex and pass it to the next task

One task in my playbook produces output sample of different types like below

stdout_lines

ex: 1

[
“_ _ _”
“farm/dt-tk-1/env: agent_tcp”
]

ex: 2

[
“_ _ _”
“test/xc-yh-1/qa: agent_tcp”
]

etc

I need to capture the second line regex:

test/xc-yh-1/qa

farm/dt-tk-1/env

I need to capture the above part. Im aware I can use set_fact with regex but Im having difficulty in forming regex. Can someone kindly help

You don't need any regexp, just add this to your stdout_lines

  <the variable>.stdout_lines.1.split(':').0

Thankyou Kai Stian , that worked !