I want to replace numbers between some part of string
for eg :.
f = "abc 123 def 23435 kill x22 y2986"
I want to replace all umber between def and y with #
Tried using the following expression , it didnt work
exp = re.sub(r"(?<=def)\d+(?=y)", "#", f)
Expected output :
abc 123 def ##### kill x## y2986