I am insanely green with regular expressions. Here is what I am trying to accomplish: I want to require an 8 character password that allows upper and lowercase letters, numbers and !@#$%^&*-_ characters. Here is what I have that doesn't appear to be working:
preg_match('([A-za-z0-9-_!@#$%^&*]{8,})', $password)
Am I missing something really obvious?
Update: Yes, I was missing something really obvious - the open bracket [. However it still returns true when I use characters like a single quote or bracket. (Which are what I am trying to avoid.)