Tuesday 1 April 2014

8. Lex program to extract email IDs from a file

Note : This program might not work with all email types. But works with the trivial ones like example@aa.com


Here is the code:

%{
%}
%%
[a-zA-Z0-9]+.[@].[a-zA-Z0-9]+.[/.].[a-zA-Z.]+ printf("%s",yytext);
[a-zA-Z 0-9]+    printf(" ");
%%
main()
{
    extern FILE *yyin;
    yyin=fopen("new","r");
    yylex();
}

3 comments:

  1. Very useful stuff…thanks for writing and sharing such an informative article. Try Email and phone extractor file tool to extract phone number and email addresses from local files.

    ReplyDelete
  2. your artical is very informative and Useful,Thanks for sharing such nice article.hop keep sharing extract email address

    ReplyDelete
  3. Good content. Thanks for sharing such great information. hope you keep sharing such kind of information Files Phone Number Extractor

    ReplyDelete