- var_dump: documentation ( source)
- preg_match: documentation ( source)
- implode: documentation ( source)
<?php
$types = ['auto', 'int', 'float', 'string', 'html', 'list', 'pattern'];
// echo '('.implode('|', $types).')';
$str = 'auto(1;25)';
preg_match('/('.implode('|', $types).')\((.*?)\)/i', $str, $matches);
var_dump($matches);