<?php $teststring = '"Hello" and "Goodbye."'; $greedyresult = preg_replace('/".*"/', '"***"', $teststring); $nongreedyresult = preg_replace('/".*?"/', '"***"', $teststring); echo "Original: $teststring\n"; echo "Greedy Replace: $greedyresult\n"; echo "Nongreedy Replace: $nongreedyresult\n"; ?>