3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 $pattern.' : '.$t ."\r\n"; } } }
Output for 4.3.0 - 7.1.0
/^(?!original$).+$/ : products /^(?![0-9]_[0-9]*x[0-9]*$).+$/ : products /^(?!original$).+$/ : categories /^(?![0-9]_[0-9]*x[0-9]*$).+$/ : categories /^(?![0-9]_[0-9]*x[0-9]*$).+$/ : original /^(?!original$).+$/ : 1_22x44 /^(?!original$).+$/ : 1_22x44a /^(?![0-9]_[0-9]*x[0-9]*$).+$/ : 1_22x44a