The code is the same, but the knowledge they represent is different. The two functions validate two separate things that just happen to have the same rules. That’s a coincidence, not a duplication.
DRY isn't about avoiding duplication at all cost, that just leads to tightly couple code that's rigid to change because an update in a single place affects multiple locations.

