Created
January 19, 2017 09:39
-
-
Save feloy/c89a1fb15eb474dd448d3968ffa67db0 to your computer and use it in GitHub Desktop.
Valid password for CNIL (France): at least 8 characters from 3 of the 4 groups: lowercase letters, uppercase letters, digits, other characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DOMAIN valid_password | |
AS text | |
CHECK(7 < char_length(VALUE) | |
AND 2 < char_length( COALESCE(substring(VALUE from '[^a-zA-Z0-9]'), '') | |
|| COALESCE(substring(VALUE from '[0-9]'), '') | |
|| COALESCE(substring(VALUE from '[A-Z]'), '') | |
|| COALESCE(substring(VALUE from '[a-z]'), ''))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment