- preg_match: documentation ( source)
<?php
$original = "original";
$generatedPath = array(
"/^(?!".$original."$).+$/",
'/^(?![0-9]_[0-9]*x[0-9]*$).+$/'
);
$test = array('products', 'categories', 'original', '1_22x44','1_22x44a');
foreach ($test as $t) {
foreach($generatedPath as $pattern) {
if(preg_match($pattern, $t)) {
echo $t ."\r\n";
}
}
}