I am trying to write a regex to filter non-minified JavaScript files from an array.
Currently, the following expression works:
array_filter($paths, function($path) {
return preg_match('@\.js$@', $path) && !preg_match('@\.min\.js$@', $path);
});
However, I wanted to write this as a single regular expression:
preg_grep('SOME_REGEX_HERE', $paths);