title: Regex with dollar sign is not terminating
body: <p>so i want to replace every <code>whitespace on the begging of each lane</code> with <code>#</code> and every <code>whitespace on the end of line</code> with <code>@</code>, but my program is not terminating it writes only <code>@</code> when as input i gave <code>aTAB</code>, like sign <code>a</code> with whitespace.</p>
  
  <pre><code>%{
  #include&lt;stdio.h&gt;
  int yylex();
  %}
  
  %%
  ^[[:space:]]* printf("#");
  ([:space:]*)$ printf("@");
  %%
  
  int main() {
  
    yylex();
  }
  </code></pre>
  
  <p>I'm just starting to learn flex and i feel kinda confused, how does <code>$</code> sign works, shouldn't it check patter at the end of line? Thanks for help</p>