ansible and pyhton

hi all,

i want use this on ansible variable :

import re
number1 = re.findall(“\d+”, ansible_hostname)

i’ve try this :

number1: "{{ re.findall**(‘\d+’, ansible_hostname) }}"**

but it’s not ok ^^

have you idea ?

i want find the number on the variable ansible_hostname :

for instance :
dev1-client → i want 1
dev2-client → i want 2
prod12-client → i want 12