I am trying to create a Regular Expression for password validation. Here are the requirements.
You don't need lookahead-checks for the first and for the fifth to eigth condition - you can check this all in the final match, like
Using your lookahead checks for conditions 2-4. For the actual match we need at least 8 characters of your allowed characters. I have used
\w intead of
a-zA-Z0-9_ to keep things a bit shorter.
You can see it working here.
Site note: Restricting characters in passwords is usually seen as a bad idea. Also xkcd has something to say about passwords.