codice:
$stringa = "0j-0j-1j";
$var = "jjj";
$stringa = preg_replace("#[^\d-]#",$var,$stringa);
echo $stringa;