shell – is there any representation for search in ansible.buildin.replace … /string/ s/toreplace/newstring/g

im wondering if there is no representation for the sed string

sed -i -E '/searchString/ s/toreplace/newstring/g' file

in ansible.buildin.replace
to replace only the ‘toreplace’ string in lines which have /searchString/ in

before and after doesnt help here.