title: To allow 0-9,a-z,A-Z and the special characters . , @ & ( ) {} [ ] : ; in text box
body: <p>I want to allow 0-9,a-z,A-Z and the special characters . , @ &amp; ( ) {} [ ] : ; in text     box.</p>
  
  <p>Please help me to write regular expression for that. Currently I have a code that replace none word character with empty data and I want to made changes so that it also allow above special character.</p>
  
  <pre><code>function deleteSpecialChar(txtName, event) {
  
      if (txtName.value != '' &amp;&amp; txtName.value.match(/^[\w]+$/) == null) {
  
          txtName.value = txtName.value.replace(/[\W]/g, '');
      };
  }
  $('input[type=text]').live('keypress keyup keydown cut copy paste', function (event) {
  
      deleteSpecialChar(this, event);
  });
  </code></pre>