%{
#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
Copyright secured by Digiprove © 2018-2020 Humble Chirammal