Hi ,Thank you all for responding to this post.
Majorly my requirement was to generate password length in range in ( 6,16) among the allowed characters,
String chars = "abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789$#%&@.";
and validating the generated random password with the rules, like
1.May not contain English dictionary words longer than 4 letters: matched case insensitive, matched forwards and backwards.
2. Must have at least 2 of the following characteristics:1 digit, 1 non alphanumeric character, 1 upper case letter, 2 lower case letters
3. May not contain your username: matched case insensitive, matched forwards and backwards.
4. May not contain common keyboard sequences (eg. 12345, aaaaa): matched case insensitive, matched forwards and backwards
Was able to achieve the points
1, using normal length validation
2,using regex,
3,string equality (also in reverse)
But unable to write regex for 4th point
Anyway I will try,
1. to write loop and validate against ASCII char and try to resolve the issue
2. try the way suggested by Winston by using groups
Thank you
Kumar