<?php

$texto = "dge_ANEXO_II_F_TJ[1].pdf";
$pattern = '/[a-z]{3}_(ANEXO|Anexo|anexo)_[A-Za-z]{1,7}_[A-Z]{1}_[A-Z0-9]{2,5}\[[0-9]{1}\].pdf$/';
preg_match($pattern, $texto, $matches);
print_r($matches);