Friday, April 12, 2019

Lex Program for Regular Expression that accepts any character except ‘\’ and ‘n’


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

ScreenShot:


No comments:

Post a Comment