%{
#include<stdio.h>
#include<stdlib.h>
%}
%%
([a-z]|[A-Z])* {printf("%d",strlen(yytext));}
%%
main()
{
yylex();
return 0;
}
int yywrap()
{
}
Sample output
test line processed
4 4 9
A website about linux, kvm,gluster, ceph, kubernetes and programming
%{
#include<stdio.h>
#include<stdlib.h>
%}
%%
([a-z]|[A-Z])* {printf("%d",strlen(yytext));}
%%
main()
{
yylex();
return 0;
}
int yywrap()
{
}
Sample output
test line processed
4 4 9