$_ = "fox comes and fox goes into forest"; #s/(.+)(fox)/$1 the $2/; #s/(?<=and)(?:\s+fox)/ the/; s/(?<=fox)(.+?)(fox)/$1 the $2/;