
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Originally posted by James Sabre:
"(?=(.*[0-9].*){2}.*)(?=(.*[a-z].*){2}.*)(?=(.*[A-Z].*){2}.*)([0-9a-zA-Z]{6})"
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
That doesn't match the second example, as far as I can tell?
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Originally posted by James Sabre:
It does for me! Test code

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
Oh, I see. Stupid me...
Clever regular expression. I wonder whether it might be a bit *too* clever, if you know what I mean...![]()
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Originally posted by James Sabre:
"(?=(.*[0-9].*){2}.*)(?=(.*[a-z].*){2}.*)(?=(.*[A-Z].*){2}.*)([0-9a-zA-Z]{6})"
Originally posted by Piet Verdriet:
You could write it a bit more compact:
since you don't need all the dot-stars, which makes it even slightly more readable!
; )
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Originally posted by James Sabre:
I had not taken the logic far enough having failed to deduce that since each of the 'look-a-heads' dictate two or more characters from their acceptance class then one just has to make sure that there are 6 characters total.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
Perhaps you know understand what I mean by "clever"...![]()
Though the regex I posted worked it was not 'clever'. The improved one is clever.Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
