RegExp Studio
TRegExpr v.0.952 - Delphi Regular Expressions

Bulgarian
English
French
German
Russian
Spanish
About TRegExpr About What's new What's new Installation Installation Regular Expressions Syntax Syntax What's new Interface What's new FAQ TRegExpr usage demos Demos AnSo@Web Author  
Unit HyperLinksDecorator
DecorateURLs DecorateEMails
This unit contains functions to decorate hyper-links (see Text2Html demo-project for usage example).

For example, replaces 'www.RegExpStudio.com' with '<a href="http://www.RegExpStudio.com">www.RegExpStudio.com</a>' or 'anso@mail.ru' with '<a href="mailto:anso@mail.ru">anso@mail.ru</a>'.

function DecorateURLs

Finds and replaces hyper links like 'http://...' or 'ftp://..' as well as links without protocol, but start with 'www.' If You want to decorate emails as well, You have to use function DecorateEMails instead.

function DecorateURLs (const AText : string; AFlags : TDecorateURLsFlagSet = [durlAddr, durlPath]) : string;

Description

Returns input text AText with decorated hyper links.

AFlags describes, which parts of hyper-link must be included into VISIBLE part of the link:
For example, if [durlAddr] then hyper link 'www.RegExpStudio.com/contacts.htm' will be decorated as '<a href="http://www.RegExpStudio.com/contacts.htm">www.RegExpStudio.com</a>'

type 
 TDecorateURLsFlags = (durlProto, durlAddr, durlPort, durlPath, durlBMark, durlParam);
 TDecorateURLsFlagSet = set of TDecorateURLsFlags;

Description

These are the possible values:

Value      Meaning


durlProto   Protocol (like 'ftp://' or 'http://')
durlAddr   TCP address or domain name (like 'RegExpStudio.com')
durlPort      Port number if specified (like ':8080')
durlPath   Path to document (like 'index.html')
durlBMark   Book mark (like '#mark')
durlParam   URL params (like '?ID=2&User=13')




function DecorateEMails


Replaces all syntax correct e-mails with '<a href="mailto:ADDR">ADDR</a>'. For example, replaces 'anso@mail.ru' with '<a href="mailto:anso@mail.ru">anso@mail.ru</a>'.

function DecorateEMails (const AText : string) : string;

Description

Returns input text AText with decorated e-mails



© 2004 Andrey V. Sorokin, Saint Petersburg, Russia
anso@mail.ru
RegExpStudio.com

Help&Manual - the best help authoring tool!