title: How to make the below regex to accept any special character
body: <pre><code>/^[^ ]([\w- \.\\\/&amp;#]+)[^ ]$/,
  </code></pre>
  
  <p>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  <code>[\w- \.\\\/&amp;#!@#$&amp;]</code>. How can we make sure the above regex accepts all special characters</p>