When in Drupal you upload a file with the same filename a new file name is created with <original-filename>_<number>.<extension>. The regexp is made to filter the supposedly original filename. After checking existence and filelength match the presuppostion is confirmed and deduplication takes place.