/^[^ ]([\w- \.\\\/&#]+)[^ ]$/,
I have the above regex. I want to make sure it accepts all special characters but i don’t want to specify the entire special character listsuch as [\w- \.\\\/&#!@#$&]. How can we make sure the above regex accepts all special characters
[^\w\s]matches any non-alphanumeric and non-whitespace character.\Smatches any non-whitespace character..matches any character except newlines.[\S\s]matches any character in a JavaScript regex.