Joining together two regex queries

Instead of going like this:

  foreach(scandir($feed->model) as $result) {
  
            if(preg_match('/.php$/', $result) && preg_match('/class/', $result)) {
                
                echo "YES";
                
            } else {
                
                echo "NO";
                
            }
            
        }

Is it possible to put them together into one preg_match function?

I slept on it over night and then realised that this question is dumb because the answer is obvious:

  foreach(scandir($feed->model) as $result) {

            if (preg_match('/class-.*\\.php$/', $result)) {

                echo "YES";

            } else {

                echo "NO";

            }

        }

:wall: