
07.05.2009, 00:10
|
|
Постоянный
Регистрация: 15.06.2008
Сообщений: 941
Провел на форуме: 5111568
Репутация:
2399
|
|
Код:
var RegExp : TRegExpr;
input : string;
begin
input := 'Memo1<a href="http://abc.def">nana</a>sabd<a href="http://aaabc.def">nangga</a>as';
RegExp := TRegExpr.Create;
RegExp.Expression := '<a href="(.+?)">(.+?)</a>';
if RegExp.Exec(input) then
repeat
showmessage('Name: '+RegExp.Match[2]+#13#10+
'Url: '+RegExp.Match[1]);
until not RegExp.ExecNext;
|
|
|