fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. [6-9][0-9]{9} {printf("Valid Mobile Number: %s\n", yytext);}
  7.  
  8. [https:]/|\|[a-zA-Z0-9]+[a-z] {printf("Valid URL: %s\n", yytext);}
  9.  
  10. [a-zA-Z_][a-zA-Z0-9_]* {printf("Valid Identifier: %s\n", yytext);}
  11.  
  12. (0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9]{4}) {printf("Valid Date (dd/mm/yyyy): %s\n", yytext);}
  13.  
  14. ([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9] {printf("Valid Time (hh:mm:ss): %s\n", yytext);}
  15.  
  16.  
  17. %%
  18.  
  19. int main() {
  20. printf("Enter input text:\n");
  21. yylex();
  22. return 0;
  23. }
Success #stdin #stdout #stderr 0.03s 6988KB
stdin
8619717155
apranjal455@gmai.com
https
06:09:2005
stdout
Standard output is empty
stderr
ERROR: /home/q1kgYH/prog:23:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? % Execution Aborted
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit