Friday, April 12, 2019

Lex Program for Regular Expression that accept any character except ‘a’ and ‘b’


%{
#include<stdio.h>
%}
%%
[^ab\n] {printf("valid");}
.* {printf("invalid");}
%%
main()
{
yylex();
}


ScreenShot:

No comments:

Post a Comment