title: Antlr Lexer exclude a certain pattern
body: <p>In Antlr Lexer, How can I achieve parsing a token like this:</p>
  
  <p>A word that contains any non-space letter but not '.{' inside it. Best I can come up with is using a semantics predicate.</p>
  
  <pre><code>WORD: WL+   {!getText().contains(".{")};
  WL: ~[ \n\r\t];
  </code></pre>
  
  <p>I'm a bit worried to use semantics predicate though cause WORD here will be lexed millions of times I would think to put a semantics predicate will hit the performance.</p>
  
  <p>This is coming from the requirement that I need to parse something like: </p>
  
  <pre><code>TOKEN_ONE.{TOKEN_TWO}
  </code></pre>
  
  <p>while TOKEN_ONE can include . and { in its letter.</p>
  
  <p>I'm using Antlr 4.</p>