[thelist] regex help - password pattern - javascript

Frank lists at frankmarion.com
Tue Sep 27 09:36:55 CDT 2005


At 08:50 AM 2005-09-27, you wrote:
>Frank, this is only true if you are only allowed alpha and numeric, I'm sure
>the rule was at least 2 alpha (excluding underscores) and at least 2
>numeric, but as for the other 4 characters, they can be anything (percent
>for example), so alpha and numeric won't necessarily always be adjacent.

It was my understanding that tha whole string was limited [a-zA-Z_0-9] . 
Are other characters permissible in the string, and we must match this 
pattern? Can the password include #?!$&, as long as there are two alphas 
and two nums with a minimum string length of 8 chars?

If we ARE limited to \w, then  at all times, in any given string of 
[a-z0--9_] , in order for a match to be successful there must by necessity 
be adjacency, it's impossible for it to be otherwise. If it's in a string, 
it's got to be next to *something*. If no such matches are found, it fails.

If we use  [\w]*[a-z_][0-9]|[0-9][a-z_]

1xxxxxxx1 = 1x and x1
xx1xx1xx   = x1 and x1
xxxx1xxx = x1 and 1x
11xxxxxx =  [nada]1 and 1x

It's an interesting puzzle. I'll keep playing with it.





Frank Marion     lists at frankmarion.com      Keep the signal high.





More information about the thelist mailing list