(Moderator)
Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.861 Beiträge
Delphi 11 Alexandria
|
AW: Link aus memo rauskopieren
5. Aug 2014, 14:02
Findet alle URLs in einem Memo:
Delphi-Quellcode:
Uses ... RegularExpressions ...
const
pattern = ' (http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?';
var
matches: TMatchCollection;
match: TMatch;
begin
matches := TRegEx.Matches( Memo.Text, pattern);
Caption := IntToStr( matches.Count);
for match in matches do
begin
//Url in match.Value
...
end;
Markus Kinzler
|