in reply to How to replace the string within a string

$_="I want to replace <P> in my string. I have to search for the <P> a +nd replace it with space. Thanks"; s/<P>/ /gi; print;
results in:
I want to replace in my string. I have to search for the and repla +ce it with space. Thanks
update: You might also want to try perldoc perlre which explains regular expressions fairly well.