fork download
  1. %{
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. %}
  6. %%
  7. [0-9a-zA-Z._%+-]+@[0-9a-zA-Z.-]+\.[a-zA-Z]{2,} { printf("It is valid"); }
  8. .|\n {printf("It is invalid")}
  9. %%
  10. int main() {
  11. printf("Enter an email address: ");
  12. yylex();
  13. return 0;
  14. }
Success #stdin #stdout #stderr 0.03s 6924KB
stdin
abdul@gmail.com
stdout
Standard output is empty
stderr
ERROR: /home/j5yX5b/prog:14:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit