I have stripped all PHP surrounding the following regular expressions components but it basically decides to put these parts into one big expression bassed on certain variables and that puts that into a preg_match_all():

$\S* // Start of the expression

(?=\S{6,}) // Minimum length = 6

(?=\S*[a-z]) // Requires lowercase letters

(?=\S*[A-Z]) // Requires uppercase letters

(?=\S*[\d]) // Requires digits

(?=\S*[\W]) // Requires special characters

$ // End of the expression

There are just a few expressions I can't get to work:

- Maximum length (If I fill in a number after the 6, the string is still validated, even if it's longer than that. Example: {6,32} still validates a string longer than 32 characters )
- No lowercase letters allowed
- No uppercase letters allowed
- No digits allowed
- No special characters allowed

I've tried googling how to do thos but I couldn't come up with the right way to do it, so any help would be greatly appreciated.