In theory, "Hey man!" and "Hey! Man!" should both be recognised, because they both end with an exclamation mark. Indeed when I check with Expresso
] or with an online JS regex tester they are both matched without problems.
"Hey! Man" on the other hand, would not, because your regex string specifically requires a special character as the final character in the string.
If you are trying to enforce password rules "must include a special character", then remove the '$' at the end of your regex, and it will match one or move special characters at any point in the input.