fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. Name[ ]+([A-Za-z]+[ ]?)* { printf("Name: %s\n", yytext + 5); }
  7. Age[ ]+[0-9]+ { printf("Age: %s\n", yytext + 4); }
  8. Email[ ]+[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,} { printf("Email: %s\n", yytext + 6); }
  9. .|\n { /* Ignore other characters */ }
  10. %%
  11.  
  12. int main(int argc, char **argv) {
  13. yylex();
  14. return 0;
  15. }
  16.  
Success #stdin #stdout #stderr 0.02s 6972KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/xPfTAK/prog:15:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit