title: Regular expression to filter special characters not working
body: <p>i am searching for a regular expression i can use to check if a user input contains special characters in a specified list.</p>
  
  <p>Here are the special characters not allowed by using a regular expression i tried to write: <code>^[`~!@#$%^&amp;*()_+={}\[\]|\\:;“’&lt;,&gt;.?๐฿]*$</code></p>
  
  <p>i went to <a href="https://regex101.com/" rel="nofollow noreferrer">https://regex101.com/</a> and i was expecting the following input to match but did it not why:</p>
  
  <pre><code>127 elmer road ??&lt;&gt;()
  </code></pre>
  
  <p>so in android java (but an be any ) i wrote the following function but it also always returns true . how can i filter all these special characters . I want a function that returns true if a given string does NOT match. </p>
  
  <pre><code>  public boolean isValid( EditText et) {
              String string = et.getText().toString();
              boolean isValid = true;
  
               final Pattern sPattern
                      = Pattern.compile("^[`~!@#$%^&amp;*()_+={}\\[\\]|\\\\:;“’&lt;,&gt;.?๐฿]*$");
  
              isValid=  !sPattern.matcher(string).matches();
  
  
              return isValid;
          }
  </code></pre>
  
  <p>update:  i tried the following also:</p>
  
  <p><a href="https://i.stack.imgur.com/n5Xpw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n5Xpw.png" alt="enter image description here"></a></p>