title: How to recognise start-of-line in an Antlr grammar?
body: <p>In the language I work with, some keywords must be at the start of the line. This is mainly because string values within the language can go over multiple lines, and strings could easily contain these keywords.</p>
  
  <p>The old yacc/lex grammar implementation I have easily deals with this because the lexer uses normal regexes to match text patterns, e.g. </p>
  
  <pre><code>^description    { actions }
  </code></pre>
  
  <p>matches '<code>description</code>' at the start of a line and then does actions.</p>
  
  <p>How can I do this in Antlr4? It does not appear to support proper regex for lexical matching. I'm using the IntelliJ plugin, and it complains when I use the '<code>^</code>' character on any lexer rule RHS.</p>