<?php
$string = <<<heredoc
Poetry is a form of literature ~ that uses aesthetic and rhythmic
qualities of language -- such as phonaesthetics, sound symbolism
metre to evoke meanings in addition to, or in place of, the prosaic ostensible meaning
heredoc;
$string = preg_replace( '/.*(--|~).*[\r]?[\n]?/', '', $string);
echo $string;
?>