(?=.[A-Z]) # must contain 1 uppercase letter (?=.[0-9]) # must contain 1 digit (?!.\n) # must not contain a newline character (?!.\s) # must not contain any whitespace characters (?=.[!$#+@%&]) # nust contain one of these symbols .{8,} # match anything with previous conditions at least 8 characters long