Nice!

(You import re twice)

Personally when I do these checks I usually store the criterias in a list as tuples: (r'regex', 'error messge')

That way I can loop through the list of criterias. But more importantly, you can add, change or remove the criterias more easily. Also the code to check each regex would have less LOC, higher readability and more ease of maintenance.

Python is fun!

Reply to this note

Please Login to reply.

Discussion

No replies yet.