This is a terrible example. First off, you're using double-quoted syntax, but it's not in double quotes. Additionally, you're confusing when regular expression metacharacters need to be escape because they're metacharacters and when they need to be escaped because they are in a double-quoted string. The PHP documentation is particularly terrible in this regard (telling you to put regular expressions in double quoted strings rather than single quoted, because PHP doesn't have a regular expression type).
[-\.\\w] means match a dash, a dot, a backslash and the w character.
Secondly, it's not anchored to the start or end of the input.
Thirdly, the LHS can be empty according to this regular expression.
Lastly, we've finally uncovered who it is that's keeping everyone from using + on the LHS to do sendmail style +folder references.