title: How to read word using lex and yacc?
body: <p>I have written a program to read data of a text file using lex and yacc.I want to compare "State" on that text file and retrieve the word after that.
  I have used below code.But it gives all the text in that text file.Please help </p>
  
  <pre><code>[0-9a-zA-Z]*"\n" { if (strcmp("State: ",yytext)!=0)
  {
  printf(yytext,"\n");}
  }
  </code></pre>