$re = '/(?:INSERT_|UPDATE_)?([NY|80]{2}[0-9]{6})_([^0-9]*)_([0-9]{4})_06_30\.(?:txt|csv)/m';
$str = 'UPDATE_80070175_LOCATION_MARKING_PERIOD_2020_06_30.txt
INSERT_80070175_STUDENT_CLASS_GRADE_DETAIL_2020_06_30.txt
INSERT_80070175_STUDENT_CLASS_ENTRY_EXIT_2020_06_30.txt
INSERT_80070175_STUD_ATTEND_DAY_2020_06_30.txt
INSERT_80070175_PROGRAMS_FACT_2020_06_30.txt
INSERT_80070175_DAY_CALENDAR_2020_06_30.txt
INSERT_80070175_CRSE_INSTRUCT_ASSIGNMENT_2020_06_30.txt
INSERT_80070175_COURSE_2020_06_30.txt
INSERT_80070175_ATTENDANCE_CODES_2020_06_30.txt
80070175_STUDENT_LITE_UPDATE_2020_06_30.txt
80070175_SCHOOL_ENTRY_EXIT_INSERT_2020_06_30.txt
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php