Test, validate and match regular expressions
Validates passwords enforcing a strict policy: at least two uppercase letters, two lowercase letters, and two digits, verified via chained lookaheads. The final \w*$ ensures the string contains only word characters (letters, digits, underscore), rejecting whitespace and special symbols anywhere. Commonly used in JavaScript form validation for password strength checking.