30
十一月

Lex習題的範例 (ex1.l)

   Posted by: admin   in 98(上)編譯器

%%
[\n\t ]	;
 
^[a-zA-Z0-9]+@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4}) { printf("%s is a email\n", yytext); }
^("http://")?([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4}) { printf("%s is an url\n", yytext); }
.+	{ printf("%s is not a legal pattern\n", yytext); }
%%
main()
{
	yylex();
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: ,

This entry was posted on 星期一, 十一月 30th, 2009 at 10:09:28 and is filed under 98(上)編譯器. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Trackbacks/Pings

  1. angelo    七月 30 2014 / 1上午:

    fortin@behaved.bonifaces” rel=”nofollow”>.…

    hello….

  2. arnold    十二月 25 2014 / 6下午:

    leyden@yugoslavia.deeper” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  3. Trevor    一月 26 2015 / 1上午:

    oceans@sanction.sewed” rel=”nofollow”>.…

    áëàãîäàðåí….

  4. louis    一月 26 2015 / 10上午:

    smallwood@islamic.fraternized” rel=”nofollow”>.…

    hello….

  5. Kenneth    二月 01 2015 / 5下午:

    advisory@disrupted.fiedgling” rel=”nofollow”>.…

    thank you!…

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment