Simple applet-capture the email address on the webpage.

Source: Internet
Author: User
1   Import  Java. Io. bufferedreader;  2   Import  Java. Io. filenotfoundexception;  3   Import  Java. Io. filereader;  4   Import  Java. Io. ioexception;  5   Import  Java. util. RegEx. matcher;  6  Import  Java. util. RegEx. pattern;  7   8   9   Public   Class  Emailspider {  10   11       /**  12   *  @ Author  Zhw  13   * @ Param  ARGs  14        */  15       Public   Static   Void  Main (string [] ARGs ){  16           17           Try  {  18 Bufferedreader BR = New Bufferedreader ( New Filereader ("111.txt" ));  19 String line = "" ;  20           21               While (Line = Br. Readline ())! = Null  ){  22               23   Parse (line );  24               25   }  26              27   BR. Close ();  28 } Catch  (Filenotfoundexception e ){  29               //  Todo auto-generated Catch Block  30   E. printstacktrace ();  31 } Catch  (Ioexception e ){  32               // Todo auto-generated Catch Block  33   E. printstacktrace ();  34   }  35           36           37   }  38   39       Private   Static   Void  Parse (string line ){  40      41 Pattern P = pattern. Compile ("[\ W [.-] + @ [\ W [.-1] + \. [\ W] +" );  42 Matcher M = P. matcher (line );  43           While  (M. Find ())  44   System. Out. println (M. Group ());  45           46           47   }  48   49 }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.