title: Java regex except combination of symbols
body: <p>I'm trying to find substing contains any character, but not include combination "[%"</p>
  
  <p>As examples:</p>
  
  <pre><code>Input: atrololo[%trololo
  Output: atrololo
  
  Input: tro[tro%tro[%trololo
  Output: tro[tro%tro
  </code></pre>
  
  <p>I already wrote regex, take any symbol except [ or %:</p>
  
  <pre><code>[A-Za-z-0-9\s!-$-&amp;/:-@\\-`\{-~]*
  </code></pre>
  
  <p>I must put in the end of my expression something like <code>[^("[%")]</code>, but i can't solve how it should input.</p>
  
  <p>You may check my regular in</p>
  
  <p><a href="https://www.regex101.com/" rel="nofollow">https://www.regex101.com/</a></p>
  
  <p>Put as test string this:</p>
  
  <pre><code>sdfasdsdfasa#@!55@321!2h/ хf[[[[[sds d
  asgfdgsdf[[[%for (int i = 0; i &lt; 5; i++){}%]
  [% fo%][%r(int i = 0; i &lt; 5; i++){ %]*[%}%]
  [%for(int i = 0; i &lt; 5; i++){%][%=i%][%}%]
  [%@n%]&lt;[%@ n + m %]*[%@%]&gt;[%@%]
  %?s.equals(""TEST"")%]TRUE[%@3%]![%@%][%?%]
  </code></pre>
  
  <p>Kind regards.</p>