When you're writing Apex Code, the compiler interprets \
as an escape meant for the source code. The Pattern class interprets \
as an escape character as well. Therefore, when you use [\\d\\s-#+@]{7,}
, that means that you're actually passing in literal \
characters. It becomes interpreted as:
[ \ d \ s-# + @ ]{7,}
| 2 3 2 4 5 6 | 7
\-------1-------/
1: Match any character in this set
2: Match a literal "\"
3: Match a literal "d"
4: Match the range "s" through "#"
5: Match a literal "+"
6: Match a literal "@"
7: Match at least 7 times consecutively
The problem here is #4: "s" comes after "#", so the compiler won't allow it. It would allow "#" through "s", but this is not your intent.
When you're using data from a string (a label, custom setting, user input, etc), you do not escape the \
, because you're not compiling Apex Code. The regex, as you've written it, would look like the following source code:
Pattern p = Pattern.compile('[\\\\d\\\\s-#+@]{7,}');
To fix this, remove the escape characters that you used to get them in the source code.
The custom setting's value should be:
[\d\s-#+@]{7,}