Friday, April 12, 2019

Lex Program for Regular Expression (a-b)?[0-9 A-Z]*

%{
#include<stdio.h>
%}
%%
(a-b)?[0-9 A-Z]* {printf("valid");}
.* {printf("invalid");}
%%
main()
{
yylex();
}

ScreenShot:



No comments:

Post a Comment