$re = '/^(?P<unit_type>SFE)(?P<unit_size>100|80|63|50|40|32|25)(?P<mounting_type>P|Z)(?P<decompression_feature>0)(?P<sep_1>-)(?P<unit_series>1X)(?P<sep_2>/)(?P<seal_material>M)(?P<additional_details>(.|[0-9])*)$/m';
$str = 'SFE50Z0-1X/M
SFE32P0-1X/M
SFE32Z0-1X/M
SFE25Z0-1X/M
SFE50P0-1X/M
SFE40P0-1X/M
SFE63P0-1X/M
SFE63Z0-1X/M
SFE80Z0-1X/M
SFE40Z0-1X/M
SFE25P0-1X/M
SFE100Z0-1X/M
SFE80P0-1X/M
SFE100P0-1X/M
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
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