$re = '/FA-I1-I2-TR-I1-I2-FA.*(*SKIP)(*F)|(?:I\d-?)*I3(?:-?I\d)*/m';
$str = '1-FA-I2-I2-I2-EX-I2-I3-FA-I1-I2-TR-I1-I2-FA-I3-I1-FA-FA-NR-I3-I2-TR-I1-I2-I1-I2-FA-I2-I1-I3-FA-QU-I1-I2-I2-I2-NR-I2-I2-NR-I1-I2-I1-NR-I3-QU-I2-I3-QU-NR-I2-I1-NR-QU-QU-I2-I1-EX';
$subst = "-";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php