Friday, April 12, 2019

Lex Program for Regular Expression ^[ab][0-9 A-Z]+

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

ScreenShot: 

No comments:

Post a Comment