Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) memo1: tmemo; button1: tbutton; procedure button1click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} uses regularexpressions, MSXML; const patternurl = 'HTTP (s )?: // ([\ W-] + \.) + [\ W-] + (/[\ W -./? % & =] *)? '; // URL address patternemail =' \ W + ([-+. ''] \ W +) * @ \ W + ([-.] \ W + )*\. \ W + ([-.] \ W +) * '; // email address patterntel =' (\ D {3} \) | \ D {3 }-)? \ D {8} '; // phone number patternidcard =' \ D {17} [\ d | x] | \ D {15 }'; // ID card number {function for obtaining webpage source code} function getwebpagetext (const aurl: string): string; begin with coxmlhttp. create do begin open ('get', aurl, false, emptyparam, emptyparam); send (emptyparam); Result: = responsetext; end; Procedure tform1.button1click (Sender: tobject ); vaR txt, URL: string; match: tmatch; begin memo1.clear; Url: = 'HTTP: // www.google.com.hk/search? Hl = ZH-tw & source = HP & biw = 1440 & BiH = 796 & Q = Email + % E7 % 94% B5 % E8 % af % 9d + % E8 % Ba % AB % E4 % BB % BD % E8 % af % 81 & btng = Google + % E6 % 90% 9C % E5 % B0 % 8B & AQ = F & AQI = & AQL = & OQ = '; TXT: = getwebpagetext (URL); For match in tregex. matches (txt, patternurl) Do memo1.lines. add (match. value); memo1.lines. add ('--------------------------'); For match in tregex. matches (txt, patternemail) Do memo1.lines. add (match. value); memo1.lines. add ('--------------------------'); For match in tregex. matches (txt, patterntel) Do memo1.lines. add (match. value); memo1.lines. add ('--------------------------'); For match in tregex. matches (txt, patternidcard) Do memo1.lines. add (match. value); memo1.lines. add ('--------------------------'); end.